* 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)
| 95 | * @returns {string} a valid dynamic import specifier |
| 96 | */ |
| 97 | function 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…