MCPcopy
hub / github.com/vitejs/vite / cleanScssBugUrl

Function cleanScssBugUrl

packages/vite/src/node/plugins/css.ts:2489–2501  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

2487// in unix, scss might append `location.href` in environments that shim `location`
2488// see https://github.com/sass/dart-sass/issues/710
2489function cleanScssBugUrl(url: string) {
2490 if (
2491 // check bug via `window` and `location` global
2492 typeof window !== 'undefined' &&
2493 typeof location !== 'undefined' &&
2494 typeof location.href === 'string'
2495 ) {
2496 const prefix = location.href.replace(/\/$/, '')
2497 return url.replace(prefix, '')
2498 } else {
2499 return url
2500 }
2501}
2502
2503// #region Sass
2504// .scss/.sass processor

Callers 2

canonicalizeFunction · 0.85
processFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected