一、使用purifyCss,遍历代码,识别已经用到的CSS
purifyCSS不再维护,使用purgecss-webpack-plugin基于purifycss开发的,mini-css-exract-plugin提取CSS插件配合使用
二、uncss,html通过jsdom加载,样式通过postCSS加载,通过document.queryselector,来识别html内不存在的选择器。
一、使用purifyCss,遍历代码,识别已经用到的CSS
purifyCSS不再维护,使用purgecss-webpack-plugin基于purifycss开发的,mini-css-exract-plugin提取CSS插件配合使用
二、uncss,html通过jsdom加载,样式通过postCSS加载,通过document.queryselector,来识别html内不存在的选择器。