Skip to content

Commit

Permalink
Encoding systemjs module name to work with Windows (#18)
Browse files Browse the repository at this point in the history
* remove .posix and encode systemjsModuleName

* decode systemjsModuleName
  • Loading branch information
emdap committed Dec 15, 2020
1 parent a3d3f12 commit ed4718f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions SystemJSPublicPathWebpackPlugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const webpack = require("webpack");
const path = require("path").posix;
const path = require("path");

const isWebpack5 = webpack.version && webpack.version.startsWith("5.");

Expand All @@ -25,7 +25,7 @@ class SystemJSPublicPathWebpackPlugin {
additionalEntries.push(
path.resolve(
__dirname,
`resource-query-public-path?systemjsModuleName=${this.options.systemjsModuleName}&rootDirectoryLevel=${rootDirectoryLevel}`
`resource-query-public-path?systemjsModuleName=${encodeURIComponent(this.options.systemjsModuleName)}&rootDirectoryLevel=${rootDirectoryLevel}`
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion resource-query-public-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ const queryObj = queryParts.reduce((result, queryPart) => {
return result;
}, {});

setPublicPath(queryObj.systemjsModuleName, Number(queryObj.rootDirectoryLevel));
setPublicPath(decodeURIComponent(queryObj.systemjsModuleName), Number(queryObj.rootDirectoryLevel));

0 comments on commit ed4718f

Please sign in to comment.