Skip to content

Commit

Permalink
fix windows cross driver path not found issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gbk committed Nov 20, 2015
1 parent bb2c355 commit 4fe6145
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/NodeStuffPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ NodeStuffPlugin.prototype.apply = function(compiler) {
compiler.parser.plugin("expression module", function() {
var moduleJsPath = path.join(__dirname, "..", "buildin", "module.js");
if(this.state.module.context) {
moduleJsPath = "./" + path.relative(this.state.module.context, moduleJsPath).replace(/\\/g, "/");
moduleJsPath = path.relative(this.state.module.context, moduleJsPath);
if(!/^[A-Z]:/i.test(moduleJsPath)) {
moduleJsPath = "./" + moduleJsPath.replace(/\\/g, "/");
}
}
return ModuleParserHelpers.addParsedVariable(this, "module", "require(" + JSON.stringify(moduleJsPath) + ")(module)");
});
Expand Down

0 comments on commit 4fe6145

Please sign in to comment.