-
Notifications
You must be signed in to change notification settings - Fork 4
/
vue.config.js
70 lines (68 loc) · 1.74 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const webpack = require("webpack");
const path = require('path');
const isBuild = process.argv.includes("build")
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
publicPath: '',
outputDir: 'dist/lib',
assetsDir: 'static',
productionSourceMap: false,
css: { extract: false },
devServer: {
port: 8000,
open: true,
overlay: {
warnings: false,
errors: true
},
},
configureWebpack: {
resolve: {
alias: {
'@': resolve('src')
}
},
plugins: [],
externals: isBuild ? {
"axios": "axios",
"clipboard": "clipboard",
"codemirror": "codemirror",
"echarts": "echarts",
"echarts-gl": "echarts-gl",
"element-ui": "element-ui",
"hotkeys-js": "hotkeys-js",
"jquery": "jquery",
"js-beautify": "js-beautify",
"ramda": "ramda",
"ready-table": "ready-table",
"richform": "richform",
"vue-i18n": "vue-i18n",
"vue-draggable-resizable-gorkys": "vue-draggable-resizable-gorkys",
"vue": "vue",
"vue-router": "vue-router",
"vue2-perfect-scrollbar": "vue2-perfect-scrollbar",
"vue-count-to": "vue-count-to",
"element-resize-detector": "element-resize-detector",
"vxe-table": "vxe-table",
} : {},
},
// to handle element icon error in build.
chainWebpack: config => {
// it can improve the speed of the first screen, it is recommended to turn on preload
config.module
.rule("fonts")
.test(/.(ttf|otf|eot|woff|woff2)$/)
.use("url-loader")
.loader("url-loader")
.tap(options => {
options = {
// limit: 10000,
name: '/static/fonts/[name].[ext]',
}
return options
})
.end()
}
}