You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udims-vue/vue.config.js

35 lines
1.0 KiB
JavaScript

module.exports = {
baseUrl: process.env.NODE_ENV === "production" ? "./" : "/",
outputDir: process.env.outputDir,
//assetsDir: 'static',
configureWebpack: config => {
if (process.env.NODE_ENV === "production") {
// 为生产环境修改配置...
config.externals = {
vue: "Vue",
vuex: "Vuex",
"vue-router": "VueRouter",
"element-ui": "ELEMENT",
devtool: 'source-map'
};
} else {
// 为开发环境修改配置...
'source-map'
}
/*config.performance={
hints:'warning',
maxEntrypointSize:500000000,
maxAssetSize:50000000,
assetFilter:function (assetFilename){
return assetFilename.endsWith('.js');
}
}*/
},
chainWebpack: config => {
config.plugin("html").tap(args => {
args[0].template = process.env.template;
return args;
});
}
};