webpack 之压缩js代码 和html文件
2021-02-10 05:18
阅读:702
标签:white style col temp space 打包 com webpack index
1.压缩JS代码,mode设置为production后,打包时自动压缩代码
mode:‘production‘,
2.压缩html文件,html文件不需要处理兼容问题,压缩文件只需要在plugins中的HtmlWebpackPlugin中配置minify即可
new HtmlWebpackPlugin({ template:‘./src/index.html‘, minify:{ //移除空格 collapseWhitespace:true, //移除注释 removeComments:true }, }),
webpack 之压缩js代码 和html文件
标签:white style col temp space 打包 com webpack index
原文地址:https://www.cnblogs.com/hllzww/p/13052973.html
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:webpack 之压缩js代码 和html文件
文章链接:http://soscw.com/index.php/essay/53429.html
文章标题:webpack 之压缩js代码 和html文件
文章链接:http://soscw.com/index.php/essay/53429.html
评论
亲,登录后才可以留言!