Skip to content

Commit 83f3a9c

Browse files
authored
bump: update to vue-cli@4 (#591)
1 parent b292e46 commit 83f3a9c

File tree

4 files changed

+33
-31
lines changed

4 files changed

+33
-31
lines changed

.env.development

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,3 @@ ENV = 'development'
33

44
# base api
55
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

babel.config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
module.exports = {
22
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+
}
514
}

package.json

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"version": "4.3.0",
44
"description": "A vue admin template with Element UI & axios & iconfont & permission control & lint",
55
"author": "Pan <[email protected]>",
6-
"license": "MIT",
76
"scripts": {
87
"dev": "vue-cli-service serve",
98
"build:prod": "vue-cli-service build",
109
"build:stage": "vue-cli-service build --mode staging",
1110
"preview": "node build/index.js --preview",
11+
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
1212
"lint": "eslint --ext .js,.vue src",
1313
"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"
1615
},
1716
"dependencies": {
1817
"axios": "0.18.1",
18+
"core-js": "3.6.5",
1919
"element-ui": "2.13.2",
2020
"js-cookie": "2.2.0",
2121
"normalize.css": "7.0.0",
@@ -26,36 +26,37 @@
2626
"vuex": "3.1.0"
2727
},
2828
"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",
3333
"@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",
3736
"babel-jest": "23.6.0",
37+
"babel-plugin-dynamic-import-node": "2.3.3",
3838
"chalk": "2.4.2",
3939
"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",
4242
"html-webpack-plugin": "3.2.0",
4343
"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",
4747
"script-ext-html-webpack-plugin": "2.1.3",
48-
"serve-static": "^1.13.2",
48+
"serve-static": "1.13.2",
4949
"svg-sprite-loader": "4.1.3",
5050
"svgo": "1.2.2",
5151
"vue-template-compiler": "2.6.10"
5252
},
53+
"browserslist": [
54+
"> 1%",
55+
"last 2 versions"
56+
],
5357
"engines": {
5458
"node": ">=8.9",
5559
"npm": ">= 3.0.0"
5660
},
57-
"browserslist": [
58-
"> 1%",
59-
"last 2 versions"
60-
]
61+
"license": "MIT"
6162
}

src/store/modules/settings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const state = {
1010

1111
const mutations = {
1212
CHANGE_SETTING: (state, { key, value }) => {
13+
// eslint-disable-next-line no-prototype-builtins
1314
if (state.hasOwnProperty(key)) {
1415
state[key] = value
1516
}

0 commit comments

Comments
 (0)