-
Notifications
You must be signed in to change notification settings - Fork 29
/
vite.config.ts
51 lines (50 loc) · 1.22 KB
/
vite.config.ts
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
import {defineConfig} from 'vite'
import vitePluginVuedoc from 'vite-plugin-doc-preview'
import vue from '@vitejs/plugin-vue'
import Pages from 'vite-plugin-pages'
import {resolve} from 'path'
import vueJsx from '@vitejs/plugin-vue-jsx'
// 表格使用formatter时需要添加vueJsx这个,要不会出错。页面同时需要添加 lang="jsx"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vueJsx({}),
vitePluginVuedoc({ previewId: 'vue demo' }),
vue({
include: [/\.vue$/, /\.md$/] // 2. Must include .md | .vd files
}),
Pages({
pagesDir: 'src/packages',
extensions: ['md']
// exclude: ['**/components/*.vue']
})
],
base: './',
build: {
outDir: 'docs'
// 去除console
/*terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
}*/
},
resolve: {
alias: [
{
find: /@\//,
replacement: resolve(__dirname, 'src') + '/'
}
],
// 使用路径别名时想要省略的后缀名,官方不建议将.vue文件省略后缀
extensions: ['.js', '.ts']
},
server: {
// 是否开启 https
https: false,
port: 3002,
host: '0.0.0.0',
open: false
}
})