* build --> webpack.prod.conf.js --> UglifyJsPlugin添加关于mangle的选项
mangle: { safari10: true }
* 打包好的index.html放到服务器里去的时候,index.html在服务器端可能是有缓存的,这需要在服务器配置不让缓存index.html
* nginx 配置如下
location = /index.html {
add_header Cache-Control "no-cache, no-store";
}
本文介绍了如何在Webpack的UglifyJsPlugin中配置mangle选项以优化代码,并提供了nginx配置示例来避免index.html被缓存,确保用户始终获取最新版本。
4290

被折叠的 条评论
为什么被折叠?



