forked from jjxliu306/ng-form-element
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
55 lines (50 loc) · 1.33 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
module.exports = {
// 修改 src 目录 为 examples 目录
pages: {
index: {
entry: 'example/main.js',
template: 'public/index.html',
filename: 'index.html',
chunks: ['chunk-vendors', 'chunk-common', 'index'],
cdn: {
css: [
'https://unpkg.com/element-ui/lib/theme-chalk/index.css'
],
js: [
"https://unpkg.com/[email protected]/dist/vue.min.js",
"https://unpkg.com/[email protected]/dist/vue-router.min.js",
"https://unpkg.com/[email protected]/dist/vuex.min.js",
"https://unpkg.com/element-ui/lib/index.js"
]
},
}
},
configureWebpack: {
// 打包忽略文件
externals: {
"element-ui": "ELEMENT",
vue: "Vue",
"vue-router": "VueRouter",
vuex: "Vuex"
}
},
productionSourceMap: false,
// 强制内联CSS
css: { extract: true },
// 扩展 webpack 配置,使 packages 加入编译
chainWebpack: config => {
//config.plugin('webpack-bundle-analyzer')
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
config.module
.rule('js')
.include
.add('/packages')
.end()
.use('babel')
.loader('babel-loader')
.tap(options => {
// 修改它的选项...
return options
})
}
}