-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
45 lines (44 loc) · 1.16 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
const { defineConfig } = require('@vue/cli-service')
const IconPlugin = require('unplugin-icons/webpack')
module.exports = defineConfig({
// 禁用对依赖包的转译处理
transpileDependencies: false,
// Webpack 配置
chainWebpack: config => {
// 加载 Markdown 格式的文件
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
})
},
// Webpack 配置
configureWebpack: {
plugins: [
// 自动下载图标配置
IconPlugin({ compiler: 'vue3', autoInstall: true })
]
},
// CSS 配置
css: {
loaderOptions: {
// SASS 配置
sass: {
// 全局引入样式文件
additionalData: `@import "@/style/variable.scss";`
}
}
},
// 开发配置
devServer: {
host: '127.0.0.1',
port: 18003,
open: true
}
})