Przeglądaj źródła

无用文件去除

wangziqian 4 lat temu
rodzic
commit
f32785bb8c

+ 0 - 1
src/main.js

@@ -16,7 +16,6 @@ import store from './store'
 import router from './router'
 
 import '@/icons' // icon
-// import '@/permission' // permission control/
 import htmlToPdf from '@/utils/htmlToPdf'
 Vue.use(htmlToPdf)
 

+ 2 - 2
src/store/index.js

@@ -3,7 +3,7 @@ import Vuex from 'vuex'
 import getters from './getters'
 import app from './modules/app'
 import settings from './modules/settings'
-import user from './modules/user'
+// import user from './modules/user'
 import data from './modules/data'
 import project from './modules/project'
 
@@ -13,7 +13,7 @@ const store = new Vuex.Store({
   modules: {
     app,
     settings,
-    user,
+    // user,
     data,
     project
   },

+ 2 - 1
src/views/mock/httprule.vue

@@ -238,7 +238,8 @@
 
 <script>
 const _ = require('lodash')
-import { fetchEnvInfo, queryById, fetchRuleList, createRule, updateRule, changeStatus, getHttpOp, getExpress, callbackQuery } from '@/api/httprule'
+import { queryById, fetchRuleList, createRule, updateRule, changeStatus, getHttpOp, getExpress, callbackQuery } from '@/api/httprule'
+import { fetchEnvInfo } from '@/api/interface'
 import waves from '@/directive/waves' // waves directive
 import { parseTime } from '@/utils'
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination

+ 2 - 1
src/views/mock/interface.vue

@@ -224,7 +224,8 @@
 </style>
 
 <script>
-import { fetchEnvInfo, fetchServiceById, fetchServiceList, fetchConsumerList, createService, updateService, changeStatus } from '@/api/interface'
+import { fetchServiceById, fetchServiceList, fetchConsumerList, createService, updateService, changeStatus } from '@/api/interface'
+import { fetchEnvInfo } from '@/api/interface'
 import waves from '@/directive/waves' // waves directive
 import { parseTime } from '@/utils'
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination

+ 2 - 1
src/views/mock/rule.vue

@@ -143,7 +143,8 @@
 </template>
 
 <script>
-import { fetchEnvInfo, fetchRuleById, fetchRuleList, createRule, updateRule, changeStatus } from '@/api/rule'
+import { fetchRuleById, fetchRuleList, createRule, updateRule, changeStatus } from '@/api/rule'
+import { fetchEnvInfo } from '@/api/interface'
 import waves from '@/directive/waves' // waves directive
 import { parseTime } from '@/utils'
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination

+ 30 - 24
vue.config.js

@@ -116,36 +116,42 @@ module.exports = {
             .optimization.splitChunks({
               chunks: 'all',
               cacheGroups: {
+                styles: {
+                  name: 'styles',
+                  test: /\.css$/,
+                  chunks: 'all',
+                  enforce: true // 忽略splitChunks的其他配置,强制将匹配到的缓存组中的文件合并为一个styles.css文件
+                },
                 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: 15, // 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
-                  chunks: 'all',
-                  reuseExistingChunk: true,
-                  enforce: true
-                },
-                echarts: {
-                  name: 'chunk-echarts',
-                  test: /[\\/]node_modules[\\/]echarts[\\/]/,
-                  chunks: 'all',
-                  priority: 10,
-                  reuseExistingChunk: true,
-                  enforce: true
-                },
-                demo: {
-                  name: 'chunk-demo',
-                  test: /[\\/]src[\\/]views[\\/]/,
-                  chunks: 'all',
-                  priority: 20,
-                  reuseExistingChunk: true,
-                  enforce: true
                 }
+                // elementUI: {
+                //   name: 'chunk-elementUI', // split elementUI into a single package
+                //   priority: 15, // 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
+                //   chunks: 'all',
+                //   reuseExistingChunk: true,
+                //   enforce: true
+                // },
+                // echarts: {
+                //   name: 'chunk-echarts',
+                //   test: /[\\/]node_modules[\\/]echarts[\\/]/,
+                //   chunks: 'all',
+                //   priority: 10,
+                //   reuseExistingChunk: true,
+                //   enforce: true
+                // },
+                // demo: {
+                //   name: 'chunk-demo',
+                //   test: /[\\/]src[\\/]views[\\/]/,
+                //   chunks: 'all',
+                //   priority: 20,
+                //   reuseExistingChunk: true,
+                //   enforce: true
+                // }
               }
             })
           config.optimization.runtimeChunk('single')