Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onAfterDone With multiple child configs #31

Open
bcis-kassel opened this issue Jul 8, 2021 · 2 comments
Open

onAfterDone With multiple child configs #31

bcis-kassel opened this issue Jul 8, 2021 · 2 comments

Comments

@bcis-kassel
Copy link

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.

@s00d
Copy link
Owner

s00d commented Jul 28, 2021

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

@Zomono
Copy link

Zomono commented Jul 29, 2021

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants