@beixi/compress
v1.0.69
Published
js,css压缩工具
Downloads
71
Readme
静态文件打包工具
支持ES5+所有特性,less支持。设计为基于文件夹压缩和打包所有.js,.css,.less,生成对应 .min. 格式。
- 安装
npm install @beixi/compress @babel/core @babel/preset-env babel-loader autoprefixer clean-webpack-plugin core-js css-loader css-minimizer-webpack-plugin file-loader less less-loader mini-css-extract-plugin postcss-loader terser-webpack-plugin uglify-js url-loader webpack webpack-chain webpack-cli -D
- 运行
#压缩文件夹
npx compress path=src
#压缩单个css
npx compress path=src/m/css/style.css
#压缩单个js
npx compress path=src/m/js/app.js
注:会在package.json中注入,默认生成webpack.config.js文件,可自定义相关配置。
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"sideEffects": [
".css",
".less"
]