Compress all html, js, and css files in the entire folder, and output other files to the specified directory without processing
npm install minify-web -g
# or
yarn global add minify-web
The src directory is compressed by default, and directory dist is entered
minify-web
Package directory
Output directory
Show help
the src directory is compressed and placed in the dist directory
minify-web
the app directory is compressed and placed in the out directory
minify-web -D app -O out
- Create the
package.json
file in the project root directory and add the following
{
// ...
"scripts": {
"minify": "minify-web"
}
// ...
}
- run
npm run minify
in the project root