52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
const isProduction = process.env.NODE_ENV === 'production';
|
||
const ProdConfig = require("./build/prod");
|
||
const DevConfig = require("./build/dev");
|
||
const VariableConfig = require('./build/variable');
|
||
|
||
module.exports = {
|
||
publicPath: './',
|
||
filenameHashing: true,
|
||
productionSourceMap: false,
|
||
parallel: require('os').cpus().length > 1,
|
||
lintOnSave: false,
|
||
/**
|
||
* vue-cli-plugin-autorouter 插件配置
|
||
* 参考文档:https://www.npmjs.com/package/vue-cli-plugin-autorouter
|
||
*/
|
||
pluginOptions: {
|
||
route: {
|
||
TemplateFolderName: 'page',
|
||
RootFolderName: './src/application',
|
||
SaveConfigPath: '../../../src/core/config/route.config.ts'
|
||
}
|
||
},
|
||
devServer: {
|
||
hot: true,
|
||
hotOnly: true,
|
||
host: '0.0.0.0',
|
||
port: 9090,
|
||
compress: true,
|
||
open: true,
|
||
openPage: '#/',
|
||
overlay: {
|
||
warnings: true,
|
||
errors: true,
|
||
}
|
||
},
|
||
configureWebpack: (config) => {
|
||
// 设置程序核心入口
|
||
config.entry.app = './src/core/run/index.run.ts';
|
||
isProduction ? new ProdConfig(config) : ''
|
||
},
|
||
chainWebpack: (config) => {
|
||
isProduction ? config.plugin('html').tap(args => {
|
||
args[0].cdn = VariableConfig.cdn;
|
||
return args;
|
||
}) : '';
|
||
new DevConfig(config);
|
||
|
||
}
|
||
|
||
};
|
||
|