|
@@ -6,10 +6,10 @@ const external = {
|
|
|
'vue-router': 'VueRouter',
|
|
|
vuex: 'Vuex',
|
|
|
axios: 'axios',
|
|
|
- // echarts: 'echarts',
|
|
|
- jquery: '$',
|
|
|
lodash: '_',
|
|
|
- moment: 'moment'
|
|
|
+ echarts: 'echarts',
|
|
|
+ // moment: 'moment',
|
|
|
+ jquery: '$'
|
|
|
}
|
|
|
|
|
|
module.exports = {
|
|
@@ -87,37 +87,26 @@ module.exports = {
|
|
|
chainWebpack: config => {
|
|
|
// single-spa
|
|
|
if (!process.env.VUE_APP_ALONE) {
|
|
|
-
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
- // 生产环境配置
|
|
|
- // config.externals(external)
|
|
|
- // config.plugin('html').tap(args => {
|
|
|
- // // html中添加cdn
|
|
|
- // args[0].cdn = cdn
|
|
|
- // return args
|
|
|
- // })
|
|
|
- // config.output.filename('./js/[name].[chunkhash:8].js')
|
|
|
- config.output.filename = function (pathData) {
|
|
|
- return pathData.chunk.name === 'app' ? './js/[name].js' : './js/[name].[chunkhash:8].js';
|
|
|
- };
|
|
|
- config.output.chunkFilename('./js/[name].[chunkhash:8].js');
|
|
|
- // config.output.chunkFilename = function (pathData) {
|
|
|
- // console.log(JSON.stringify(pathData.chunk), '11')
|
|
|
- // return pathData.chunk.name === 'app' ? './js/[name].js' : './js/[name].[chunkhash:8].js';
|
|
|
- // };
|
|
|
+ // 生产环境配置
|
|
|
+ config.externals(external)
|
|
|
+ config.plugin('html').tap(args => {
|
|
|
+ // html中添加cdn
|
|
|
+ args[0].cdn = cdn
|
|
|
+ return args
|
|
|
+ })
|
|
|
|
|
|
- config.optimization.minimize(true)
|
|
|
- .minimizer('terser')
|
|
|
- .tap(args => {
|
|
|
- let { terserOptions } = args[0];
|
|
|
- terserOptions.compress.drop_console = true;
|
|
|
- terserOptions.compress.drop_debugger = true;
|
|
|
- return args
|
|
|
- });
|
|
|
+ config.optimization.minimize(true)
|
|
|
+ .minimizer('terser')
|
|
|
+ .tap(args => {
|
|
|
+ const { terserOptions } = args[0]
|
|
|
+ terserOptions.compress.drop_console = true
|
|
|
+ terserOptions.compress.drop_debugger = true
|
|
|
+ return args
|
|
|
+ })
|
|
|
} else {
|
|
|
config.devServer.set('inline', false)
|
|
|
config.devServer.set('hot', true)
|
|
|
- config.output.filename('js/[name].js')
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -128,7 +117,6 @@ module.exports = {
|
|
|
.use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
|
|
|
}
|
|
|
},
|
|
|
- filenameHashing: false,
|
|
|
configureWebpack: {
|
|
|
output: {
|
|
|
library: 'bigMemberSubApp',
|