Skip to content

Commit cfd8d42

Browse files
committed
Merge pull request webpack#1654 from gbk/webpack-1
Fix windows cross driver path not found issue
2 parents b595281 + f770eae commit cfd8d42

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎lib/NodeStuffPlugin.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ 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).replace(/\\/g, "/");
92+
moduleJsPath = path.relative(this.state.module.context, moduleJsPath);
93+
if(!/^[A-Z]:/i.test(moduleJsPath)) {
94+
moduleJsPath = "./" + moduleJsPath.replace(/\\/g, "/");
95+
}
9396
}
9497
return ModuleParserHelpers.addParsedVariable(this, "module", "require(" + JSON.stringify(moduleJsPath) + ")(module)");
9598
});

0 commit comments

Comments
 (0)