Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
fix(index): use path.posix for platform consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-ciniawsky committed Feb 21, 2018
1 parent c0785d1 commit 9d89419
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Expand Up @@ -19,7 +19,7 @@ export default function loader(content) {
});

let outputPath = (
typeof options.outputPath === 'function' ? options.outputPath(url) : path.join(options.outputPath || '', url)
typeof options.outputPath === 'function' ? options.outputPath(url) : path.posix.join(options.outputPath || '', url)
);

if (options.useRelativePath) {
Expand All @@ -32,9 +32,9 @@ export default function loader(content) {
const relativePath = relativeUrl && `${path.dirname(relativeUrl)}/`;
// eslint-disable-next-line no-bitwise
if (~relativePath.indexOf('../')) {
outputPath = path.join(outputPath, relativePath, url);
outputPath = path.posix.join(outputPath, relativePath, url);
} else {
outputPath = path.join(relativePath, url);
outputPath = path.posix.join(relativePath, url);
}
}

Expand All @@ -43,7 +43,7 @@ export default function loader(content) {
if (options.publicPath !== undefined) {
// support functions as publicPath to generate them dynamically
publicPath = JSON.stringify(
typeof options.publicPath === 'function' ? options.publicPath(url) : path.join(options.publicPath || '', url),
typeof options.publicPath === 'function' ? options.publicPath(url) : path.posix.join(options.publicPath || '', url),
);
} else {
publicPath = `__webpack_public_path__ + ${JSON.stringify(outputPath)}`;
Expand Down

0 comments on commit 9d89419

Please sign in to comment.