forked from InsidePlugins/plugin-diary-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
51 lines (49 loc) · 1.13 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 type { UserConfigExport, Plugin } from 'vite'
/**
* 解决 target = "_self" on nav links 报错问题
*
* @see issues#1015 https://github.com/vuejs/vitepress/discussions/1015#discussioncomment-3177860
* @returns { Object }
*/
// const NavLinkPatch = (): Plugin => ({
// name: 'override-target-blank',
// enforce: 'pre',
// transform: (code, id) => {
// if (id.endsWith('VPLink.vue')) {
// return code.replace('_blank', '_self')
// }
// }
// })
export default (): UserConfigExport => {
return {
server: {
port: 1216
},
// plugins: [NavLinkPatch()],
optimizeDeps: {
exclude: ['vitepress']
},
ssr: {
format: 'cjs'
},
legacy: {
buildSsrCjsExternalHeuristics: true
},
// css: {
// postcss: {
// plugins: [
// {
// postcssPlugin: 'internal:charset-removal',
// AtRule: {
// charset: (atRule) => {
// if (atRule.name === 'charset') {
// atRule.remove()
// }
// }
// }
// }
// ]
// }
// }
}
}