-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvue.config.js
48 lines (46 loc) · 1.38 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
const cdnPrefix = "//cdn.jsdelivr.net/npm/"
// const cdnPrefix = "//unpkg.zhimg.com/"
// const cdnPrefix = "//unpkg.com/"
const cdn = {
css: [
cdnPrefix + "element-ui@2.15.6/lib/theme-chalk/index.css",
],
js: [
cdnPrefix + "vue@2.6.11/dist/vue.min.js",
cdnPrefix + "element-ui@2.15.6/lib/index.js",
cdnPrefix + "jspdf@2.5.0/dist/jspdf.umd.min.js",
]
}
module.exports = {
publicPath: './',
outputDir:"docs", // 打包时生成的生产环境构建文件的目录
productionSourceMap: process.env.NODE_ENV !== 'production',
chainWebpack: config => {
config.resolve.symlinks(true)
if (process.env.NODE_ENV === 'production') {
config.plugin('webpack-bundle-analyzer')
.use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
.end()
}
},
configureWebpack: {
externals: {
vue: "Vue",
"element-ui": "ELEMENT",
"jspdf": "jspdf",
canvg: "canvg",
html2canvas: "html2canvas",
dompurify: "dompurify"
}
},
pages: {
index: {
entry: 'src/main.js',
template: 'public/index.html',
filename: 'index.html',
title: '图片转PDF',
chunks: ['chunk-vendors', 'chunk-common', 'index'],
cdn: cdn
}
}
}