Skip to content

Commit e9d06a7

Browse files
committed
Merge branch 'fix_nesting_webpack_require' of https://github.com/jRiest/webpack into jRiest-fix_nesting_webpack_require
2 parents 28aa362 + a287fb1 commit e9d06a7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/FunctionModuleTemplatePlugin.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ module.exports = FunctionModuleTemplatePlugin;
1212
FunctionModuleTemplatePlugin.prototype.apply = function(moduleTemplate) {
1313
moduleTemplate.plugin("render", function(moduleSource, module) {
1414
var source = new ConcatSource();
15-
source.add("/***/ function(" + ["module", "exports", "__webpack_require__"].concat(module.arguments || []).join(", ") + ") {\n\n");
15+
var defaultArguments = ["module", "exports"];
16+
if (!module.external) {
17+
defaultArguments.push("__webpack_require__");
18+
}
19+
source.add("/***/ function(" + defaultArguments.concat(module.arguments || []).join(", ") + ") {\n\n");
1620
source.add(new PrefixSource(this.outputOptions.sourcePrefix, moduleSource));
1721
source.add("\n\n/***/ }");
1822
return source;

0 commit comments

Comments
 (0)