-
Notifications
You must be signed in to change notification settings - Fork 78
Support MultiCompiler / MultiStats #8
Comments
Okay, I've discovered applying the plugin to both compilers separately doesn't really work because the console may read 'DONE' because the most recent compilation succeeded but it obviously doesn't take into account the other compilation which may still be in an error state. Would you be open to a PR for this? |
Hi @richardscarrott, I'll accept any PR with tests 😄 |
Fixed in #9 |
What does the config look like to use this with a multi compiler? Do I add the plugin to both compilers? |
@DylanPiercey you'll need to apply the plugin to the the multi compiler returned from
|
@richardscarrott awesome - thanks! Gonna try this out now. |
It works perfectly :D. |
webpack(config)
returns aMultiCompiler
if your config is an array of configurations andmultiCompiler.plugin('done', multiStats => {});
providesMultiStats
meaning this plugin could potentially receive aMultiCompiler
instance.Currently it works well with the
MultiCompiler
as it only uses theplugin
method which is supported on theMultiCompiler
.It falls down however when interfacing with the
MultiStats
instance as it looks something like this:So it would need to get errors and warnings from each of those child
Stats
instances.The other problem is it reads
DONE Compiled successfully in NaNms
becausestats.startTime
andstats.endTime
don't exist onMultiStats
, it'd have to be calculated from both of the child stats.I'm not sure if this is something you want to support as it is possible to simply apply the plugin to both compilers separately but it means stdout will be flushed to twice so I think it would only show the error from one of the compilations, regardless of 'severity'. Also, the build time would only reflect one of the compilations....not sure if there would be any other implications you can think of with this approach?
As an aside, great work on the plugin -- makes all the difference during development!
The text was updated successfully, but these errors were encountered: