安装依赖
1 pnpm install filemanager-webpack-plugin --save-dev
在vue.config.js中添加如下代码
const FileManagerPlugin = require('filemanager-webpack-plugin')//引入插件
1 configureWebpack: { 2 plugins: [ 3 new FileManagerPlugin({ 4 events: { 5 onEnd: { 6 delete: ['./dist.zip'], 7 archive: [{ source: './dist', destination: './dist.zip' }] 8 } 9 } 10 }) 11 ] 12 }
具体位置参考下图
最终效果
运行 npm run build 后,在项目目录下会同时新增 dist文件夹 和 dist.zip压缩包。
标签:dist,zip,压缩成,filemanager,FileManagerPlugin,webpack,vue2 From: https://www.cnblogs.com/lanxi0320/p/17837048.html