Skip to content

Commit 8d10b22

Browse files
committed
force relative path for "module" require
fixes webpack#1596
1 parent f3d65ef commit 8d10b22

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lib/NodeStuffPlugin.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ NodeStuffPlugin.prototype.apply = function(compiler) {
8989
compiler.parser.plugin("expression module", function() {
9090
var moduleJsPath = path.join(__dirname, "..", "buildin", "module.js");
9191
if(this.state.module.context) {
92-
moduleJsPath = path.relative(this.state.module.context, moduleJsPath);
92+
moduleJsPath = "./" + path.relative(this.state.module.context, moduleJsPath).replace(/\\/g, "/");
9393
}
9494
return ModuleParserHelpers.addParsedVariable(this, "module", "require(" + JSON.stringify(moduleJsPath) + ")(module)");
9595
});

0 commit comments

Comments
 (0)