步骤一
npm i filemanager-webpack-plugin -D
步骤二
const FileManagerPlugin = require('filemanager-webpack-plugin');
const outputDir = 'dist';
module.exports = {
configureWebpack: (config) => {
if (process.env.NODE_ENV === 'production') {
const fileManagerPlugin = new FileManagerPlugin({
events: {
onEnd: {
delete: [
`./${outputDir}.zip`
],
archive: [
{ source: `./${outputDir}`, destination: `./${outputDir}/${outputDir}.zip` }
]
}
}
});
config.plugins.push(fileManagerPlugin)
}
},
}











网友评论