-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvue.config.js
More file actions
65 lines (63 loc) · 1.49 KB
/
vue.config.js
File metadata and controls
65 lines (63 loc) · 1.49 KB
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
// 配置路径别名
var path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
// 配置基础链接地址,根据发布环境添加
publicPath: process.env.NODE_ENV === 'production'
? ''
: '/',
outputDir: 'preview',
// 使用easy-mock模拟数据服务
devServer: {
// proxy: {
// '/tsadmin/': {
// target: 'http://localhost:7300',
// changeOrigin: true,
// pathRewrite: {
// '^/tsadmin': '/mock/618dcbc9f21bed6a4cb6666b/tsadmin'
// }
// }
// }
},
productionSourceMap: false,
lintOnSave: process.env.NODE_ENV !== 'production',
assetsDir: 'static',
filenameHashing: true, // 发布打包文件是否有哈希后缀
configureWebpack: {
resolve: {
alias: {
'@': resolve('src'),
//'@@': resolve('src/components')
}
}
},
chainWebpack: config => {
config.module
.rule('svg')
.exclude.add(resolve('src/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
config.module.rule('md')
.test(/\.md/)
.use('vue-loader')
.loader('vue-loader')
.end()
.use('vue-markdown-loader')
.loader('vue-markdown-loader/lib/markdown-compiler')
.options({
raw: true
})
}
}