Skip to content

onAfterDone With multiple child configs #31

Open

Description

@bcis-kassel

Hi,
I have a webpack config with two child-configs (one for the frontend and one for the backend).
In order to execute my onAfterDone-scripts in webpacks watch mode, I have to add the webpack-shell-plugin-next to both configs (frontend and backend). Otherwise, my script will only be executed on rebuild of the config that includes the webpack-shell-plugin-next. The problem with that solution is, that my script is executed twice, if both configuration are rebuilt.

I also tried to add a 3rd configuration that just contains the webpack-shell-plugin-next, but this configuration terminates immediately and executed the onAfterDone-script before the other configurations are finished.

So my question is: How do I have to setup webpack-shell-plugin-next to execute my script only once, while webpack rebuilds only some of the child configurations. Even if all child configurations are rebuilt, the runtime of them varies.

Thanks of the great plugin so far.

Activity

  1. s00d commented on Jul 28, 2021

    @s00d
    Owner

    Hello. Create an example, it's so hard to understand.

  2. Zomono commented on Jul 29, 2021

    @Zomono

    It is more a problem of webpack. Webpack does not provide afterALLDone hooks.
    Have a look at the workaround descriped in the answer of
    https://stackoverflow.com/questions/68496721/webpack-execute-task-after-all-configurations-are-done-or-before-all
    for an example.

    It is all about returning an array (export default [{...}, {...}, [...}]) of webpack configugrations and the need to execute tasks after all configrations are done and not after a single configuration is done.

    If you have an idea how to workaround this problem this would be very useful, otherwise this issue could be closed as it is more a problem with webpack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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