Skip to content

Commit 9975b5e

Browse files
committed
fix: review changes
1 parent 1c28304 commit 9975b5e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class MiniCssExtractPlugin {
142142
);
143143
}
144144

145-
module.buildInfo = module.buildInfo || { assets: {} };
145+
module.buildInfo = module.buildInfo || {};
146146
module.buildInfo.assets = {
147147
...module.buildInfo.assets,
148148
...assets,

src/loader.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function pitch(request) {
7878
);
7979

8080
let source;
81-
let assets = {};
81+
const assets = {};
8282
childCompiler.hooks.afterCompile.tap(pluginName, (compilation) => {
8383
source =
8484
compilation.assets[childFilename] &&
@@ -87,7 +87,7 @@ export function pitch(request) {
8787
// Collect assets from modules
8888
compilation.modules.forEach((module) => {
8989
if (module.buildInfo && module.buildInfo.assets) {
90-
assets = { ...assets, ...module.buildInfo.assets };
90+
Object.assign(assets, module.buildInfo.assets);
9191
}
9292
});
9393

0 commit comments

Comments
 (0)