config的配置
module.exports = {
publicPath: '/',
outputDir: '../web',
indexPath: './index.html',
lintOnSave: false,
crossorigin: 'anonymous',
assetsDir: '',
integrity: true,
productionSourceMap: false,
devServer: {
proxy: {
'/csf-permission/': {
target: 'http://192.168.100.44:8011/csf-permission/',
changeOrigin: true,
pathRewrite: {
'^/csf-permission/': ''
}
},
'/api/': {
target: 'http://192.168.250.213:50010/ds/',
changeOrigin: true,
pathRewrite: {
'^/api/': ''
}
}
}
},
configureWebpack: {
output: {
filename: process.env.NODE_ENV === 'production' ? 'js/[name].[contenthash:8].js' : 'js/[name].[hash:8].js',
chunkFilename: process.env.NODE_ENV === 'production' ? 'js/[name].[chunkhash:8].js' : 'js/[name].[hash:8].js'
},
optimization: {
minimize: true,
minimizer: [
// new UglifyJSPlugin()
],
runtimeChunk: 'single',
splitChunks: {
chunks: 'all',
maxInitialRequests: Infinity,
minSize: 0,
minChunks: 1,
automaticNameDelimiter: '.',
cacheGroups: {
main: {
name: 'main',
test: /[\\/]node_modules[\\/]vue/,
priority: 20
},
'element-ui': {
name: 'main',
test: /[\\/]node_modules[\\/]element-ui/,
priority: 20
},
utils: {
name: 'utils',
test: /[\\/]node_modules[\\/](axios|lodash|qs)/,
priority: 14
},
encrypt: {
name: 'encrypt',
test: /[\\/]node_modules[\\/](js-md5|node-forge)/,
priority: 13
},
vendors: {
name: 'vendors',
test: /[\\/]node_modules[\\/]/,
priority: 10
}
}
}
}
},
pluginOptions: {
i18n: {
locale: 'zh-CN',
fallbackLocale: 'zh-CN',
localeDir: 'locales',
enableInSFC: true
}
}
}