Skip to content

Commit ed4718f

Browse files
authored
Encoding systemjs module name to work with Windows (#18)
* remove .posix and encode systemjsModuleName * decode systemjsModuleName
1 parent a3d3f12 commit ed4718f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

SystemJSPublicPathWebpackPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const webpack = require("webpack");
2-
const path = require("path").posix;
2+
const path = require("path");
33

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

@@ -25,7 +25,7 @@ class SystemJSPublicPathWebpackPlugin {
2525
additionalEntries.push(
2626
path.resolve(
2727
__dirname,
28-
`resource-query-public-path?systemjsModuleName=${this.options.systemjsModuleName}&rootDirectoryLevel=${rootDirectoryLevel}`
28+
`resource-query-public-path?systemjsModuleName=${encodeURIComponent(this.options.systemjsModuleName)}&rootDirectoryLevel=${rootDirectoryLevel}`
2929
)
3030
);
3131
}

resource-query-public-path.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ const queryObj = queryParts.reduce((result, queryPart) => {
77
return result;
88
}, {});
99

10-
setPublicPath(queryObj.systemjsModuleName, Number(queryObj.rootDirectoryLevel));
10+
setPublicPath(decodeURIComponent(queryObj.systemjsModuleName), Number(queryObj.rootDirectoryLevel));

0 commit comments

Comments
 (0)