Skip to content
This repository was archived by the owner on Jul 27, 2021. It is now read-only.
This repository was archived by the owner on Jul 27, 2021. It is now read-only.

Support MultiCompiler / MultiStats #8

@richardscarrott

Description

@richardscarrott

webpack(config) returns a MultiCompiler if your config is an array of configurations and multiCompiler.plugin('done', multiStats => {}); provides MultiStats meaning this plugin could potentially receive a MultiCompiler instance.

Currently it works well with the MultiCompiler as it only uses the plugin method which is supported on the MultiCompiler.

It falls down however when interfacing with the MultiStats instance as it looks something like this:

{
    stats: [
        Stats,
        Stats
    ]
}

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 because stats.startTime and stats.endTime don't exist on MultiStats, 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions