-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
40 lines (38 loc) · 923 Bytes
/
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
/* eslint-disable @typescript-eslint/no-var-requires */
const merge = require('webpack-merge')
const tsImportPluginFactory = require('ts-import-plugin')
const path = require('path')
const resolve = dir => {
return path.join(__dirname, dir)
}
module.exports = {
devServer: {
port: 8888
},
parallel: false,
chainWebpack: config => {
config.module
.rule('ts')
.use('ts-loader')
.tap(options => {
const opt = merge(options, {
transpileOnly: true,
getCustomTransformers: () => ({
before: [
tsImportPluginFactory({
libraryName: 'vant',
libraryDirectory: 'es',
style: true
})
]
}),
compilerOptions: {
module: 'es2015'
}
})
return opt
})
config.resolve.alias
.set('@', resolve('src'))
}
}