mirror of https://github.com/webpack/webpack.git
Merge pull request #1654 from gbk/webpack-1
Fix windows cross driver path not found issue
This commit is contained in:
commit
cfd8d42cec
|
|
@ -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)");
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue