Skip to content

Commit 665984f

Browse files
committed
升级vue、vue-router、vuex、element-ui
1 parent 0d21c05 commit 665984f

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

build/webpack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const webpack = require('webpack');
22
const path = require('path');
33
const HtmlWebpackPlugin = require('html-webpack-plugin');
4+
const { VueLoaderPlugin } = require('vue-loader');
45

56
const webpackConfig = {
67
entry: {
@@ -77,7 +78,8 @@ const webpackConfig = {
7778
filename: 'index.html',
7879
template: path.resolve(__dirname, '../index.html'),
7980
inject: true
80-
})
81+
}),
82+
new VueLoaderPlugin()
8183
]
8284
};
8385

build/webpack.dist.config.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ const webpack = require('webpack');
22
const path = require('path');
33
const HtmlWebpackPlugin = require('html-webpack-plugin');
44
const CleanWebpackPlugin = require('clean-webpack-plugin');
5-
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
5+
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
66
const ExtractTextPlugin = require('extract-text-webpack-plugin');
7+
const { VueLoaderPlugin } = require('vue-loader');
78

89
const extractSass = new ExtractTextPlugin({
910
filename: 'styles.[contenthash].css',
@@ -13,7 +14,7 @@ const extractSass = new ExtractTextPlugin({
1314
const webpackConfig = {
1415
entry: {
1516
app: path.resolve(__dirname, '../src/main.js'),
16-
vendor: ['vue', 'element-ui', 'vue-router']
17+
vendor: ['vue', 'element-ui', 'vue-router', 'vuex', 'echarts']
1718
},
1819
output: {
1920
path: path.join(__dirname, '../dist'),
@@ -104,7 +105,7 @@ const webpackConfig = {
104105
warnings: false
105106
},
106107
mangle: {
107-
except: ['$super', '$', 'exports', 'require'] // 以上变量‘$super’, ‘$’, ‘exports’ or ‘require’,不会被混淆
108+
except: ['$super', '$', 'exports', 'require'] // 以上变量‘$super’, ‘$’, ‘exports’ or ‘require’,不会被混淆
108109
},
109110
output: {
110111
comments: false
@@ -129,7 +130,8 @@ const webpackConfig = {
129130
removeEmptyAttributes: true,
130131
collapseWhitespace: true
131132
}
132-
})
133+
}),
134+
new VueLoaderPlugin()
133135
]
134136
};
135137

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"license": "MIT",
1919
"devDependencies": {
2020
"autoprefixer": "^7.1.3",
21-
"axios": "^0.17.1",
21+
"axios": "^0.18.0",
2222
"babel-core": "^6.26.0",
2323
"babel-eslint": "^8.0.3",
2424
"babel-loader": "^7.1.2",
@@ -28,7 +28,7 @@
2828
"clean-webpack-plugin": "^0.1.17",
2929
"css-loader": "^0.28.5",
3030
"echarts": "^3.8.5",
31-
"element-ui": "^2.0.9",
31+
"element-ui": "^2.3.6",
3232
"eslint": "^4.13.1",
3333
"eslint-config-airbnb-base": "^12.1.0",
3434
"eslint-plugin-html": "^4.0.1",
@@ -45,11 +45,10 @@
4545
"sass-loader": "^6.0.6",
4646
"style-loader": "^0.19.1",
4747
"url-loader": "^0.6.2",
48-
"vue": "^2.5.13",
49-
"vue-loader": "^13.6.1",
48+
"vue": "^2.5.16",
49+
"vue-loader": "^15.0.1",
5050
"vue-router": "^3.0.1",
51-
"vue-style-loader": "^4.1.0",
52-
"vue-template-compiler": "^2.5.13",
51+
"vue-template-compiler": "^2.5.16",
5352
"vuex": "^3.0.1",
5453
"webpack": "^3.8.1",
5554
"webpack-bundle-analyzer": "^2.9.1",

0 commit comments

Comments
 (0)