forked from vite-pwa/vite-plugin-pwa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
54 lines (49 loc) · 1.18 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
52
53
54
import { defineConfig } from 'vite'
import Components from 'unplugin-vue-components/vite'
import { presetAttributify, presetUno } from 'unocss'
import Unocss from 'unocss/vite'
import NavbarFix from './plugins/navbar'
export default defineConfig({
ssr: {
format: 'cjs',
},
legacy: {
buildSsrCjsExternalHeuristics: true,
},
build: {
// sourcemap: true,
// minify: false,
ssrManifest: false,
manifest: false,
},
optimizeDeps: {
exclude: [
'@vueuse/core',
'vitepress',
],
},
server: {
hmr: {
overlay: false,
},
},
plugins: [
// https://github.com/antfu/vite-plugin-components
Components({
dirs: [
'.vitepress/theme/components',
],
// allow auto load markdown components under `./src/components/`
extensions: ['vue', 'md'],
// allow auto import and register components used in markdown
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
// generate `components.d.ts` for ts support with Volar
dts: '.vitepress/components.d.ts',
}),
NavbarFix(),
// https://github.com/unocss/unocss
Unocss({
presets: [presetUno(), presetAttributify()],
}),
],
})