We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1、webpack5中devServer其中后,打开的页面,控制台显示 socket链接失败, 大概率是端口问题,换一个端口就好了; 2、 利用mini-css-extract-plugin插件提取css后,修改js文件,页面更新,但是修改css文件,页面不更新。检查该插件的配置:
webpack5
devServer
mini-css-extract-plugin
css
js
new MiniCssExtractPlugin({ filename: 'bundle.[contenthash].css' //输出css文件名称 })
开发环境下,不要带hash或者contenthash,就可以解决刷新问题。生产环境需要带,可以用来解决缓存问题。 webpack官网有这样一个一笔带过的解释:
hash
contenthash
webpack
使用 filename: "[contenthash].css" 启动长期缓存。根据需要添加 [name]。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1、
webpack5
中devServer
其中后,打开的页面,控制台显示 socket链接失败, 大概率是端口问题,换一个端口就好了;2、 利用
mini-css-extract-plugin
插件提取css
后,修改js
文件,页面更新,但是修改css
文件,页面不更新。检查该插件的配置:开发环境下,不要带
hash
或者contenthash
,就可以解决刷新问题。生产环境需要带,可以用来解决缓存问题。webpack
官网有这样一个一笔带过的解释:The text was updated successfully, but these errors were encountered: