Skip to content

Commit 87698de

Browse files
perf: avoid calling stats.toJson if possible
1 parent 2c6bc51 commit 87698de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: packages/webpack-plugin/src/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ class LoadablePlugin {
7575
// Add a custom output.jsonpFunction: __LOADABLE_LOADED_CHUNKS__
7676
compiler.options.output.jsonpFunction = '__LOADABLE_LOADED_CHUNKS__'
7777

78-
compiler.hooks.emit.tapAsync('@loadable/webpack-plugin', this.handleEmit)
78+
if (this.opts.outputAsset || this.opts.writeToDisk) {
79+
compiler.hooks.emit.tapAsync('@loadable/webpack-plugin', this.handleEmit)
80+
}
7981
}
8082
}
8183

0 commit comments

Comments
 (0)