Skip to content

Commit 840efad

Browse files
committed
inline cacheAssetsAndApplyPlugins helper as it heavily relies on "this" anyways
1 parent 5321ae6 commit 840efad

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

lib/Compilation.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,16 +1144,14 @@ class Compilation extends Tapable {
11441144
}
11451145

11461146
createModuleAssets() {
1147-
function cacheAssetsAndApplyPlugins(name) {
1148-
const file = this.getPath(name);
1149-
this.assets[file] = module.assets[name];
1150-
this.applyPlugins2("module-asset", module, file);
1151-
}
1152-
11531147
for(let i = 0; i < this.modules.length; i++) {
11541148
const module = this.modules[i];
11551149
if(module.assets) {
1156-
Object.keys(module.assets).forEach(cacheAssetsAndApplyPlugins, this);
1150+
Object.keys(module.assets).forEach((assetName) => {
1151+
const fileName = this.getPath(assetName);
1152+
this.assets[fileName] = module.assets[assetName];
1153+
this.applyPlugins2("module-asset", module, fileName);
1154+
});
11571155
}
11581156
}
11591157
}

0 commit comments

Comments
 (0)