前言
每次都要手动打zip包,很烦,所有就直接用插件了,不过要注意版本哦,不然会失败的
filemanager-webpack-plugin
: filemanager-webpack-plugin
步骤
安装插件
npm install filemanager-webpack-plugin@1.0.0 --save-dev
配置插件
const FileManagerWebpackPlugin = require('filemanager-webpack-plugin') module.exports = { plugins: [ new FileManagerWebpackPlugin ({ onEnd: { mkdir: ['./dist'], delete: [ './dist.zip', ], archive: [ {source: './dist', destination: './dist.zip'}, ] } }) ], }
效果
npm run build
学无止境,谦卑而行.