require.extension should translate to undefined

fixes #209
This commit is contained in:
Tobias Koppers 2014-03-19 23:27:18 +01:00
parent b1d5ed3dd6
commit a134fae430
1 changed files with 3 additions and 0 deletions

View File

@ -63,6 +63,9 @@ NodeStuffPlugin.prototype.apply = function(compiler) {
return true;
});
compiler.parser.plugin("expression require.extensions", function(expr) {
var dep = new ConstDependency("(void 0)", expr.range);
dep.loc = expr.loc;
this.state.current.addDependency(dep);
if(!this.state.module) return;
this.state.module.warnings.push(new UnsupportedFeatureWarning(this.state.module, "require.extensions is not supported by webpack. Use a loader instead."));
return true;