forked from external-repos/squoosh
Fixing windows build (#849)
Co-authored-by: Ingvar Stepanyan <rreverser@google.com>
This commit is contained in:
@@ -18,6 +18,8 @@ import {
|
||||
resolve as resolvePath,
|
||||
dirname,
|
||||
normalize as nomalizePath,
|
||||
sep as pathSep,
|
||||
posix,
|
||||
} from 'path';
|
||||
|
||||
import postcss from 'postcss';
|
||||
@@ -172,14 +174,15 @@ export default function (resolveFileUrl) {
|
||||
return `export default ${cssStr};`;
|
||||
}
|
||||
if (id.startsWith(addPrefix)) {
|
||||
const path = id.slice(addPrefix.length);
|
||||
const path = nomalizePath(id.slice(addPrefix.length));
|
||||
return (
|
||||
`import css from 'css:${path}';\n` +
|
||||
`import css from ${JSON.stringify('css:' + path)};\n` +
|
||||
`import appendCss from '${appendCssModule}';\n` +
|
||||
`appendCss(css);\n`
|
||||
);
|
||||
}
|
||||
if (id.endsWith(moduleSuffix)) {
|
||||
const path = nomalizePath(id.slice(0, -moduleSuffix.length));
|
||||
if (!pathToResult.has(id)) {
|
||||
throw Error(`Cannot find ${id} in pathToResult`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user