Skip to content

Commit 86eb7ae

Browse files
committed
chore: update
1 parent 8cc0ceb commit 86eb7ae

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/core/src/plugins/EntryChunkPlugin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class EntryChunkPlugin {
4848

4949
apply(compiler: Rspack.Compiler) {
5050
compiler.hooks.entryOption.tap(PLUGIN_NAME, (_context, entries) => {
51+
console.time('entryOption');
5152
for (const name in entries) {
5253
const entry = (entries as Rspack.EntryStaticNormalized)[name];
5354
if (!entry) continue;
@@ -85,9 +86,11 @@ class EntryChunkPlugin {
8586
this.reactDirectives[name] = reactDirective;
8687
}
8788
}
89+
console.timeEnd('entryOption');
8890
});
8991

9092
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
93+
console.time('chunkAsset');
9194
compilation.hooks.chunkAsset.tap(PLUGIN_NAME, (chunk, filename) => {
9295
const isJs = JS_EXTENSIONS_PATTERN.test(filename);
9396
if (!isJs) return;
@@ -105,9 +108,11 @@ class EntryChunkPlugin {
105108
this.reactDirectives[filename] = reactDirective;
106109
}
107110
});
111+
console.timeEnd('chunkAsset');
108112
});
109113

110114
compiler.hooks.make.tap(PLUGIN_NAME, (compilation) => {
115+
console.time('processAssets');
111116
compilation.hooks.processAssets.tap(PLUGIN_NAME, (assets) => {
112117
if (!this.enabledImportMetaUrlShim) return;
113118

@@ -168,12 +173,15 @@ class EntryChunkPlugin {
168173
}
169174
},
170175
);
176+
console.timeEnd('processAssets');
171177
});
172178

173179
compiler.hooks.assetEmitted.tap(PLUGIN_NAME, (file, { targetPath }) => {
180+
console.time('assetEmitted');
174181
if (this.shebangInjectedAssets.has(file)) {
175182
chmodSync(targetPath, this.shebangChmod);
176183
}
184+
console.timeEnd('assetEmitted');
177185
});
178186
}
179187
}

0 commit comments

Comments
 (0)