const path = require('path');
const routes = require('./src/routes/index');
const FileManagerWebpackPlugin = require('filemanager-webpack-plugin');
const isDev = process.env.NODE_ENV === 'development';
export default {
base: '/admin/',
treeShaking: true,
publicPath: './',
routes,
hash: true,
chainWebpack(config, { webpack }) {
if (!isDev) {
// 将dist压缩为dist.zip 压缩包
config.plugin('filemanager-webpack-plugin').use(FileManagerWebpackPlugin, [
{
events: {
onEnd: {
delete: ['./dist.zip'],
archive: [
{
source: './dist',
destination: './dist.zip'
}
]
}
}
}
]);
}
}
};
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)