const FileManagerPlugin = require('filemanager-webpack-plugin');
詳情請到 https://www.npmjs.com/ 一看究竟
貼個我實際開發中用到的例子吧,所實現的功能就是 打包時 在項目中
1、自動創建 zip文件夾
2、將打包輸出的 dist 文件夾 放到 臨時文件夾tempzip下。
3、將tempzip打包 放到 zip 文件夾下,供自己使用。
//打包 config.plugins.push(new filemanager( { onEnd: { //創建目錄 mkdir: ['./zip', './tempzip/' + zipName], //復制文件到tempzip copy: [{ source: './dist', destination: './tempzip/' + zipName },], //打包temzip,輸出到zip文件夾下 archive: [{ source: './tempzip/', destination: './zip/' + zipName + '.zip' }], //刪除tempzip delete: [ './tempzip/' ] } } ));
有幫助請點推薦哦,蟹蟹!