![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
浏览器性能优化
fdyputi
这个作者很懒,什么都没留下…
展开
-
vue打包之后关闭console.log
在本地测试时可以打印console.log,打包之后不打印在build下的webpack.prod.conf.js中添加drop_console: true new UglifyJsPlugin({ uglifyOptions: { compress: { warnings: false, drop_debugger: true, //打包之后关闭debugger drop_console: true // 打包之后关闭cons原创 2021-06-03 16:22:26 · 567 阅读 · 0 评论 -
浏览器性能优化
1.静态资源的压缩和合并(1) 打包时对文件进行压缩 config/index.js文件 productionGzip: true,(2) css压缩:1.无效代码删除 2.css语义合并(3) js压缩于混乱: 1.无效字符的删除 2.剔除注释 3.代码语义的缩减和优化2.静态资源缓存(通过连接名称控制缓存,只有内容改变的时候,连接名称才会改变)vue缓存机制 3.第三方库使用CDN的方式引入4.使用SSR后端渲染,数据直接输出到HTML中(server side render原创 2020-12-29 14:50:07 · 120 阅读 · 2 评论