Skip to content

Commit

Permalink
perf: avoid calling stats.toJson if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgepigdaniel committed Dec 20, 2019
1 parent 2c6bc51 commit 87698de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/webpack-plugin/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ class LoadablePlugin {
// Add a custom output.jsonpFunction: __LOADABLE_LOADED_CHUNKS__
compiler.options.output.jsonpFunction = '__LOADABLE_LOADED_CHUNKS__'

compiler.hooks.emit.tapAsync('@loadable/webpack-plugin', this.handleEmit)
if (this.opts.outputAsset || this.opts.writeToDisk) {
compiler.hooks.emit.tapAsync('@loadable/webpack-plugin', this.handleEmit)
}
}
}

Expand Down

0 comments on commit 87698de

Please sign in to comment.