-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Update webpack-dev-server config to work with version 4 #3122
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,35 +18,41 @@ if (runningWebpackDevServer) { | |
}) | ||
} | ||
|
||
devConfig = merge(devConfig, { | ||
devServer: { | ||
clientLogLevel: 'none', | ||
compress: devServer.compress, | ||
quiet: devServer.quiet, | ||
disableHostCheck: devServer.disable_host_check, | ||
host: devServer.host, | ||
port: devServer.port, | ||
https: devServer.https, | ||
hot: devServer.hmr, | ||
contentBase, | ||
inline: devServer.inline || devServer.hmr, | ||
injectClient: devServer.hmr, | ||
injectHot: devServer.hmr, | ||
useLocalIp: devServer.use_local_ip, | ||
public: devServer.public, | ||
publicPath, | ||
historyApiFallback: { disableDotRule: true }, | ||
headers: devServer.headers, | ||
overlay: devServer.overlay, | ||
stats: { | ||
colors: true, | ||
entrypoints: false, | ||
errorDetails: true, | ||
modules: false, | ||
moduleTrace: false | ||
}, | ||
watchOptions: devServer.watch_options | ||
const devServerConfig = { | ||
devMiddleware: { | ||
publicPath | ||
}, | ||
compress: devServer.compress, | ||
allowedHosts: devServer.allowed_hosts, | ||
host: devServer.host, | ||
port: devServer.port, | ||
https: devServer.https, | ||
hot: devServer.hmr, | ||
liveReload: !devServer.hmr, | ||
historyApiFallback: { disableDotRule: true }, | ||
headers: devServer.headers, | ||
static: { | ||
publicPath: contentBase | ||
} | ||
} | ||
|
||
if (devServer.static) { | ||
devServerConfig.static = { ...devServerConfig.static, ...devServer.static } | ||
} | ||
|
||
if (devServer.client) { | ||
devServerConfig.client = devServer.client | ||
} | ||
|
||
devConfig = merge(devConfig, { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't this override all local (user-side) changes to the config though? We're trying to change this config and our changes keep getting overridden by defaults. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What specific changes are you trying to make that are being overridden? I was under the impression that From what I can see, this is a similar pattern to webpacker 4 (old line 21 of this diff) |
||
stats: { | ||
colors: true, | ||
entrypoints: false, | ||
errorDetails: true, | ||
modules: false, | ||
moduleTrace: false | ||
}, | ||
devServer: devServerConfig | ||
}) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@t27duck @guillaumebriday Do we need to be on the lookout for changes to the webpacker.yml file as updating this won't be obvious to current installations? Surely not existing beta users. I guess we'll need to double check the upgrade docs one final time before the final release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will open a PR for that to update the
upgrade.md
file. 👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justin808 what I've been telling people in the various discords and slacks I'm in is to treat it like the "upgrade" from 5 to the betas where you back up the original file, take the new default from the gem, and reapply any custom changes.