-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
37 lines (37 loc) · 960 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
const path = require('path');
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false,
css: {
loaderOptions: {
stylus: {
// 引入静态 stylus 文件进行打包
additionalData: `@import "${path.resolve(__dirname, './src/assets/css/index.styl')}";`
}
}
},
configureWebpack: {
resolve: {
alias: {
// 配置别名
'@': path.resolve(__dirname, 'src'),
'assets': path.resolve(__dirname, 'src/assets')
},
fallback: {
"path": require.resolve("path-browserify")
}
}
},
chainWebpack: config => {
config.module
.rule('ts')
.test(/\.ts$/)
.use('ts-loader')
.loader('ts-loader')
.options({
transpileOnly: true, // 仅转译,不进行类型检查
appendTsSuffixTo: [/\.vue$/] // 对 .vue 文件进行类型检查
})
}
})