Skip to content

Commit a134fae

Browse files
committed
require.extension should translate to undefined
fixes webpack#209
1 parent b1d5ed3 commit a134fae

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎lib/NodeStuffPlugin.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ NodeStuffPlugin.prototype.apply = function(compiler) {
6363
return true;
6464
});
6565
compiler.parser.plugin("expression require.extensions", function(expr) {
66+
var dep = new ConstDependency("(void 0)", expr.range);
67+
dep.loc = expr.loc;
68+
this.state.current.addDependency(dep);
6669
if(!this.state.module) return;
6770
this.state.module.warnings.push(new UnsupportedFeatureWarning(this.state.module, "require.extensions is not supported by webpack. Use a loader instead."));
6871
return true;

0 commit comments

Comments
 (0)