-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Make compatible with webpack-dev-server 4.0.0 #2994
Comments
And it has much less dependencies ;) |
Is there any news about this issue :) ? |
Yes, #3057 is one thing that has to be done. Another issue I ran into is that
|
Here's my NOTE: updated Aug 2 to support weback-dev-server 4.0rc0 process.env.NODE_ENV = process.env.NODE_ENV || 'development'
const webpackConfig = require('./base')
const devServerConfig = {
client: {
logging: webpackConfig.devServer.clientLogLevel,
overlay: webpackConfig.devServer.overlay,
},
compress: webpackConfig.devServer.compress,
devMiddleware: {
publicPath: webpackConfig.devServer.publicPath,
},
hot: webpackConfig.devServer.injectHot,
host: webpackConfig.devServer.host,
port: webpackConfig.devServer.port,
https: webpackConfig.devServer.https,
hot: webpackConfig.devServer.hot,
historyApiFallback: webpackConfig.devServer.historyApiFallback,
headers: webpackConfig.devServer.headers,
static: [
{
directory: webpackConfig.devServer.contentBase,
watch: true,
}
],
};
if (webpackConfig.devServer.quiet) {
webpackConfig.infrastructureLogging.level = 'none';
}
if (webpackConfig.devServer.useLocalIp) {
devServerConfig.host = 'local-ip';
}
if (webpackConfig.devServer.disableHostCheck) {
devServerConfig.allowedHosts = 'all';
}
webpackConfig.stats = webpackConfig.devServer.stats;
webpackConfig.devServer = devServerConfig;
module.exports = webpackConfig; It's a bit tricky to parse the changed configurations from the changelog for wds, but this should handle it. If you have custom pack paths or a more advanced configuration you may want to verify that everything is being set correctly. |
webpack-dev-server 4 entered the RC version stage |
Webpack Dev Server 4 has now been released as a stable 4.0.0 release. What needs to be done to make webpacker compatible with webpack-dev-server@4.0.0 When I upgrade webpack-dev-server to 4.0.0 when using webpacker@6.0.0.rc.1 I get the folloing error
|
The patch I posted above still works if you want to upgrade sooner, but when I briefly looked into this earlier rails/webpacker would need to update the following for more official support:
I don't have enough of an understanding on how the YML configuration gets passed through to the JS but I think those are the three main files that handle it. |
There is a JS config file that read the "default config" from a YAML file with default config So to get rid of the unwanted options either the user need an extra statement to remove it or update the default config file from |
Thanks for this! Just a small note for others trying this same snippet:
|
Thanks @RSO, However It would be better if webpacker users didn't have to use a custom config to use the latest webpack-dev-server. I think #3122 seems like a reasonable solution. That way when upgrading to webpacker 6.0 you would also upgrade to dev-server 4.0 |
Agree with @anark |
For those who want to try out #3122 I posted a comment in that PR |
Solved via #3122. |
webpack-dev-server has a new beta release(4.0.0-beta.2) that features built in webpack 5 support.
Would be great to make webpacker 6.0 compatible with this as well
https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md#400-beta0-2020-11-27
The text was updated successfully, but these errors were encountered: