소스 검색

bump: update to vue-cli@4 (#591)

花裤衩 4 년 전
부모
커밋
83f3a9cc57
4개의 변경된 파일33개의 추가작업 그리고 31개의 파일을 삭제
  1. 0 9
      .env.development
  2. 11 2
      babel.config.js
  3. 21 20
      package.json
  4. 1 0
      src/store/modules/settings.js

+ 0 - 9
.env.development

@@ -3,12 +3,3 @@ ENV = 'development'
3 3
 
4 4
 # base api
5 5
 VUE_APP_BASE_API = '/dev-api'
6
-
7
-# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
8
-# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
9
-# It only does one thing by converting all import() to require().
10
-# This configuration can significantly increase the speed of hot updates,
11
-# when you have a large number of pages.
12
-# Detail:  https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
13
-
14
-VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 11 - 2
babel.config.js

@@ -1,5 +1,14 @@
1 1
 module.exports = {
2 2
   presets: [
3
-    '@vue/app'
4
-  ]
3
+    // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
4
+    '@vue/cli-plugin-babel/preset'
5
+  ],
6
+  'env': {
7
+    'development': {
8
+      // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
9
+      // This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
10
+      // https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html
11
+      'plugins': ['dynamic-import-node']
12
+    }
13
+  }
5 14
 }

+ 21 - 20
package.json

@@ -3,19 +3,19 @@
3 3
   "version": "4.3.0",
4 4
   "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint",
5 5
   "author": "Pan <panfree23@gmail.com>",
6
-  "license": "MIT",
7 6
   "scripts": {
8 7
     "dev": "vue-cli-service serve",
9 8
     "build:prod": "vue-cli-service build",
10 9
     "build:stage": "vue-cli-service build --mode staging",
11 10
     "preview": "node build/index.js --preview",
11
+    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
12 12
     "lint": "eslint --ext .js,.vue src",
13 13
     "test:unit": "jest --clearCache && vue-cli-service test:unit",
14
-    "test:ci": "npm run lint && npm run test:unit",
15
-    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
14
+    "test:ci": "npm run lint && npm run test:unit"
16 15
   },
17 16
   "dependencies": {
18 17
     "axios": "0.18.1",
18
+    "core-js": "3.6.5",
19 19
     "element-ui": "2.13.2",
20 20
     "js-cookie": "2.2.0",
21 21
     "normalize.css": "7.0.0",
@@ -26,36 +26,37 @@
26 26
     "vuex": "3.1.0"
27 27
   },
28 28
   "devDependencies": {
29
-    "@vue/cli-plugin-babel": "3.6.0",
30
-    "@vue/cli-plugin-eslint": "^3.9.1",
31
-    "@vue/cli-plugin-unit-jest": "3.6.3",
32
-    "@vue/cli-service": "3.6.0",
29
+    "@vue/cli-plugin-babel": "4.4.4",
30
+    "@vue/cli-plugin-eslint": "4.4.4",
31
+    "@vue/cli-plugin-unit-jest": "4.4.4",
32
+    "@vue/cli-service": "4.4.4",
33 33
     "@vue/test-utils": "1.0.0-beta.29",
34
-    "autoprefixer": "^9.5.1",
35
-    "babel-core": "7.0.0-bridge.0",
36
-    "babel-eslint": "10.0.1",
34
+    "autoprefixer": "9.5.1",
35
+    "babel-eslint": "10.1.0",
37 36
     "babel-jest": "23.6.0",
37
+    "babel-plugin-dynamic-import-node": "2.3.3",
38 38
     "chalk": "2.4.2",
39 39
     "connect": "3.6.6",
40
-    "eslint": "5.15.3",
41
-    "eslint-plugin-vue": "5.2.2",
40
+    "eslint": "6.7.2",
41
+    "eslint-plugin-vue": "6.2.2",
42 42
     "html-webpack-plugin": "3.2.0",
43 43
     "mockjs": "1.0.1-beta3",
44
-    "runjs": "^4.3.2",
45
-    "sass": "^1.26.8",
46
-    "sass-loader": "^7.1.0",
44
+    "runjs": "4.3.2",
45
+    "sass": "1.26.8",
46
+    "sass-loader": "8.0.2",
47 47
     "script-ext-html-webpack-plugin": "2.1.3",
48
-    "serve-static": "^1.13.2",
48
+    "serve-static": "1.13.2",
49 49
     "svg-sprite-loader": "4.1.3",
50 50
     "svgo": "1.2.2",
51 51
     "vue-template-compiler": "2.6.10"
52 52
   },
53
+  "browserslist": [
54
+    "> 1%",
55
+    "last 2 versions"
56
+  ],
53 57
   "engines": {
54 58
     "node": ">=8.9",
55 59
     "npm": ">= 3.0.0"
56 60
   },
57
-  "browserslist": [
58
-    "> 1%",
59
-    "last 2 versions"
60
-  ]
61
+  "license": "MIT"
61 62
 }

+ 1 - 0
src/store/modules/settings.js

@@ -10,6 +10,7 @@ const state = {
10 10
 
11 11
 const mutations = {
12 12
   CHANGE_SETTING: (state, { key, value }) => {
13
+    // eslint-disable-next-line no-prototype-builtins
13 14
     if (state.hasOwnProperty(key)) {
14 15
       state[key] = value
15 16
     }