You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[webpack-dev-middleware] ConcurrentCompilationError: You ran Webpack twice. Each instance only supports a single concurrent compilation at a time.
#4947
Closed
gonandriy opened this issue
Jul 18, 2023
· 4 comments
Per webpack/webpack-cli#2408 (comment), the correct way to configure webpack-dev-server in a multi-config setup is to add the devServer block only to the first config:
The one instance of webpack-dev-server will serve files for both of your configurations! This is very convenient, but it does present challenges if you want devServer to be configured differently for each of your webpack configs (e.g. in @gonandriy's case above, having different static values). This does not appear to be possible, except by running entirely separate processes for each webpack-dev-server, using the --config-name flag to select which configuration to run for each.
Bug report
Actual Behavior
If I export multiple configurations, as described here
https://webpack.js.org/configuration/configuration-types/#exporting-multiple-configurations
and run
webpack serve
I see this error
And watching for files changing does not work!
webpack.config.js is very simple
Expected Behavior
The webpack dev server is running and watches after file changing and always serve the most recent compiled content.
The text was updated successfully, but these errors were encountered: