|
@@ -88,196 +88,196 @@ module.exports = {
|
|
|
.plugin('ScriptExtHtmlWebpackPlugin')
|
|
|
.after('html')
|
|
|
.use('script-ext-html-webpack-plugin', [{
|
|
|
- // `runtime` must same as runtimeChunk name. default is `runtime`
|
|
|
+ // `runtime` must same as runtimeChunk name. default is `runtime`
|
|
|
inline: /runtime\..*\.js$/
|
|
|
}])
|
|
|
.end()
|
|
|
config
|
|
|
.optimization.splitChunks({
|
|
|
- chunks: 'all',
|
|
|
- cacheGroups: {
|
|
|
- libs: {
|
|
|
- name: 'chunk-libs',
|
|
|
- test: /[\\/]node_modules[\\/]/,
|
|
|
- priority: 10,
|
|
|
- chunks: 'initial' // only package third parties that are initially dependent
|
|
|
- },
|
|
|
- elementUI: {
|
|
|
- name: 'chunk-elementUI', // split elementUI into a single package
|
|
|
- priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
|
|
- test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
|
|
- },
|
|
|
- echarts: {
|
|
|
- name: 'chunk-echarts',
|
|
|
- priority: 20,
|
|
|
- test: /[\\/]node_modules[\\/]_?echarts(.*)/
|
|
|
- },
|
|
|
- flv: {
|
|
|
- name: 'chunk-flv',
|
|
|
- priority: 20,
|
|
|
- test: /[\\/]node_modules[\\/]_?flv(.*)/
|
|
|
- },
|
|
|
- jsBeautify: {
|
|
|
- name: 'chunk-vue-js-beautify',
|
|
|
- priority: 20,
|
|
|
- test: /[\\/]node_modules[\\/]_?js-beautify(.*)/
|
|
|
- },
|
|
|
- jsencrypt: {
|
|
|
- name: 'chunk-vue-jsencrypt',
|
|
|
- priority: 20,
|
|
|
- test: /[\\/]node_modules[\\/]_?jsencrypt(.*)/
|
|
|
- },
|
|
|
- commons: {
|
|
|
- name: 'chunk-commons',
|
|
|
- test: resolve('src/components'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- comprehensive: {
|
|
|
- name: 'chunk-comprehensive',
|
|
|
- test: resolve('src/views/comprehensive'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- creditViolation: {
|
|
|
- name: 'chunk-creditViolation',
|
|
|
- test: resolve('src/views/creditViolation'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- dashboard: {
|
|
|
- name: 'chunk-dashboard',
|
|
|
- test: resolve('src/views/dashboard'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- emergencyManagement: {
|
|
|
- name: 'chunk-emergencyManagement',
|
|
|
- test: resolve('src/views/emergencyManagement'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- gasManage3_0: {
|
|
|
- name: 'chunk-gasManage3_0',
|
|
|
- test: resolve('src/views/gasManage3_0'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- gasManage_syd: {
|
|
|
- name: 'chunk-gasManage_syd',
|
|
|
- test: resolve('src/views/gasManage_syd'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- hazardManagement: {
|
|
|
- name: 'chunk-hazardManagement',
|
|
|
- test: resolve('src/views/hazardManagement'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- hierarchicalControl: {
|
|
|
- name: 'chunk-hierarchicalControl',
|
|
|
- test: resolve('src/views/hierarchicalControl'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- medicUniversity_3_1: {
|
|
|
- name: 'chunk-medicUniversity-3_1',
|
|
|
- test: resolve('src/views/medicUniversity-3_1'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- mine: {
|
|
|
- name: 'chunk-mine',
|
|
|
- test: resolve('src/views/mine'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- safetyEducationExam: {
|
|
|
- name: 'chunk-safetyEducationExam',
|
|
|
- test: resolve('src/views/safetyEducationExam'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- secureAccess: {
|
|
|
- name: 'chunk-secureAccess',
|
|
|
- test: resolve('src/views/secureAccess'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- securityCheck: {
|
|
|
- name: 'chunk-securityCheck',
|
|
|
- test: resolve('src/views/securityCheck'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- studentViews: {
|
|
|
- name: 'chunk-studentViews',
|
|
|
- test: resolve('src/views/studentViews'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- system: {
|
|
|
- name: 'chunk-system',
|
|
|
- test: resolve('src/views/system'), // can customize your rules
|
|
|
- priority: 0,
|
|
|
- minSize: 0,
|
|
|
- minChunks: 1,
|
|
|
- enforce:true,
|
|
|
- reuseExistingChunk: true
|
|
|
- },
|
|
|
- }
|
|
|
- })
|
|
|
+ chunks: 'all',
|
|
|
+ cacheGroups: {
|
|
|
+ libs: {
|
|
|
+ name: 'chunk-libs',
|
|
|
+ test: /[\\/]node_modules[\\/]/,
|
|
|
+ priority: 10,
|
|
|
+ chunks: 'initial' // only package third parties that are initially dependent
|
|
|
+ },
|
|
|
+ elementUI: {
|
|
|
+ name: 'chunk-elementUI', // split elementUI into a single package
|
|
|
+ priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
|
|
+ test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
|
|
+ },
|
|
|
+ echarts: {
|
|
|
+ name: 'chunk-echarts',
|
|
|
+ priority: 20,
|
|
|
+ test: /[\\/]node_modules[\\/]_?echarts(.*)/
|
|
|
+ },
|
|
|
+ flv: {
|
|
|
+ name: 'chunk-flv',
|
|
|
+ priority: 20,
|
|
|
+ test: /[\\/]node_modules[\\/]_?flv(.*)/
|
|
|
+ },
|
|
|
+ jsBeautify: {
|
|
|
+ name: 'chunk-vue-js-beautify',
|
|
|
+ priority: 20,
|
|
|
+ test: /[\\/]node_modules[\\/]_?js-beautify(.*)/
|
|
|
+ },
|
|
|
+ jsencrypt: {
|
|
|
+ name: 'chunk-vue-jsencrypt',
|
|
|
+ priority: 20,
|
|
|
+ test: /[\\/]node_modules[\\/]_?jsencrypt(.*)/
|
|
|
+ },
|
|
|
+ commons: {
|
|
|
+ name: 'chunk-commons',
|
|
|
+ test: resolve('src/components'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ comprehensive: {
|
|
|
+ name: 'chunk-comprehensive',
|
|
|
+ test: resolve('src/views/comprehensive'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ creditViolation: {
|
|
|
+ name: 'chunk-creditViolation',
|
|
|
+ test: resolve('src/views/creditViolation'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ dashboard: {
|
|
|
+ name: 'chunk-dashboard',
|
|
|
+ test: resolve('src/views/dashboard'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ emergencyManagement: {
|
|
|
+ name: 'chunk-emergencyManagement',
|
|
|
+ test: resolve('src/views/emergencyManagement'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ gasManage3_0: {
|
|
|
+ name: 'chunk-gasManage3_0',
|
|
|
+ test: resolve('src/views/gasManage3_0'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ gasManage_syd: {
|
|
|
+ name: 'chunk-gasManage_syd',
|
|
|
+ test: resolve('src/views/gasManage_syd'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ hazardManagement: {
|
|
|
+ name: 'chunk-hazardManagement',
|
|
|
+ test: resolve('src/views/hazardManagement'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ hierarchicalControl: {
|
|
|
+ name: 'chunk-hierarchicalControl',
|
|
|
+ test: resolve('src/views/hierarchicalControl'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ medicUniversity_3_1: {
|
|
|
+ name: 'chunk-medicUniversity-3_1',
|
|
|
+ test: resolve('src/views/medicUniversity-3_1'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ mine: {
|
|
|
+ name: 'chunk-mine',
|
|
|
+ test: resolve('src/views/mine'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ safetyEducationExam: {
|
|
|
+ name: 'chunk-safetyEducationExam',
|
|
|
+ test: resolve('src/views/safetyEducationExam'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ secureAccess: {
|
|
|
+ name: 'chunk-secureAccess',
|
|
|
+ test: resolve('src/views/secureAccess'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ securityCheck: {
|
|
|
+ name: 'chunk-securityCheck',
|
|
|
+ test: resolve('src/views/securityCheck'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ studentViews: {
|
|
|
+ name: 'chunk-studentViews',
|
|
|
+ test: resolve('src/views/studentViews'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ system: {
|
|
|
+ name: 'chunk-system',
|
|
|
+ test: resolve('src/views/system'), // can customize your rules
|
|
|
+ priority: 0,
|
|
|
+ minSize: 0,
|
|
|
+ minChunks: 1,
|
|
|
+ enforce:true,
|
|
|
+ reuseExistingChunk: true
|
|
|
+ },
|
|
|
+ }
|
|
|
+ })
|
|
|
config.optimization.runtimeChunk('single'),
|
|
|
- {
|
|
|
- from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
|
|
|
- to: './', //到根目录下
|
|
|
- }
|
|
|
+ {
|
|
|
+ from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
|
|
|
+ to: './', //到根目录下
|
|
|
+ }
|
|
|
}
|
|
|
)
|
|
|
}
|