MCPcopy Index your code
hub / github.com/webpack/sass-loader / normalizeImportSpecifier

Function normalizeImportSpecifier

src/utils.js:97–107  ·  view source on GitHub ↗

* Convert a string `implementation` option into something the ECMAScript * `import()` expression actually accepts. Bare package specifiers and * `file:` URLs are passed through unchanged; absolute filesystem paths * (including Windows paths like `C:\\...`) are converted to `file:` URLs * — dynam

(specifier)

Source from the content-addressed store, hash-verified

95 * @returns {string} a valid dynamic import specifier
96 */
97function normalizeImportSpecifier(specifier) {
98 if (specifier.startsWith("file:")) {
99 return specifier;
100 }
101
102 if (path.isAbsolute(specifier)) {
103 return url.pathToFileURL(specifier).href;
104 }
105
106 return specifier;
107}
108
109/**
110 * This function is not Webpack-specific and can be used by tools wishing to mimic `sass-loader`'s behaviour, so its signature should not be changed.

Callers 1

getSassImplementationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…