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
After upgrading to v12, webpack@5 now by default enables the devServer.client.overlay option, which shows a blocking modal whenever a compilation warning or error occurs. This is very obstructive, and we should be able to easily modify this by overriding the option. In addition, progress is disabled, and we should be able to turn this on.
However, these configs are not making their way to the webpack dev server. I tracked it down to the sequence of how the internal webpack dev config was being shallowly merged:
When a custom `webpackConfig.devServer.client` option is set, they are
currently being overridden by the `baseConfig.client` field.
Ensure that field is extendible by consumers while also ensuring the
base config values stay fixed.
styleguidist#2033
dannobytes
changed the title
Webpack "devServer.client" unable to be customized
Webpack "devServer.*" options unable to be customized
Sep 19, 2022
* fix: ensure devserver client options are configurable
When a custom `webpackConfig.devServer.client` option is set, they are
currently being overridden by the `baseConfig.client` field.
Ensure that field is extendible by consumers while also ensuring the
base config values stay fixed.
#2033
* fix: ensure all devServer options are overridable; add tests
Current behavior
After upgrading to v12, webpack@5 now by default enables the
devServer.client.overlay
option, which shows a blocking modal whenever a compilation warning or error occurs. This is very obstructive, and we should be able to easily modify this by overriding the option. In addition,progress
is disabled, and we should be able to turn this on.However, these configs are not making their way to the webpack dev server. I tracked it down to the sequence of how the internal webpack dev config was being shallowly merged:
react-styleguidist/src/scripts/create-server.ts
Lines 36 to 39 in a460fcc
Because the
baseConfig
contains aclient
field, it's always overwriting what's being passed through from...webpackConfig.devServer
.Solution
A simple fix would be reorder this to ensure the baseConfig is applied first, while merging onto it the
webpackConfig.devServer
, e.g.This would ensure our options from the styleguide.config file were being passed through.
Expected behavior
When overriding
webpack.devServer.client
options, they should be passed through so I can enable progress and/or turn off overlays.The text was updated successfully, but these errors were encountered: