generated from antfu-collective/vitesse
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
91 lines (88 loc) · 2.56 KB
/
vite.config.ts
File metadata and controls
91 lines (88 loc) · 2.56 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { fileURLToPath, URL } from "node:url"
import { resolve, dirname } from "node:path"
import Vue from "@vitejs/plugin-vue"
import Icons from "unplugin-icons/vite"
import IconsResolver from "unplugin-icons/resolver"
import Components from "unplugin-vue-components/vite"
import Layouts from "vite-plugin-vue-layouts"
import generateSitemap from "vite-ssg-sitemap"
import { unheadVueComposablesImports } from "@unhead/vue"
import UnheadVite from "@unhead/addons/vite"
import AutoImport from "unplugin-auto-import/vite"
import { defineConfig } from "vite"
import Unfonts from "unplugin-fonts/vite"
import type { ViteSSGOptions } from "vite-ssg"
import Markdown from "unplugin-vue-markdown/vite"
import VueRouter from "unplugin-vue-router/vite"
import { VueRouterAutoImports } from "unplugin-vue-router"
import { ViteImageOptimizer } from "vite-plugin-image-optimizer"
const ssgOptions: ViteSSGOptions = {
script: "async",
formatting: "minify",
onFinished() {
generateSitemap({
hostname: "https://hoppscotch.com/",
})
},
}
// https://vitejs.dev/config
export default defineConfig({
base: "/",
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
"~/": resolve(dirname(fileURLToPath(import.meta.url)), "src") + "/",
},
},
plugins: [
VueRouter({
extensions: [".vue", ".md"],
}),
Vue({
include: [/\.vue$/, /\.md$/],
}),
// https://github.com/JohnCampionJr/vite-plugin-vue-layouts
Layouts(),
// https://github.com/unplugin/unplugin-vue-markdown
Markdown({
headEnabled: true,
}),
// https://github.com/antfu/unplugin-vue-components
Components({
extensions: ["vue", "md"],
resolvers: [
IconsResolver({
prefix: "icon",
}),
],
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
}),
// https://github.com/FatehAK/vite-plugin-image-optimizer
ViteImageOptimizer({}),
// https://github.com/unplugin/unplugin-icons
Icons(),
// https://github.com/antfu/unplugin-auto-import
AutoImport({
imports: [
"vue",
"@vueuse/core",
unheadVueComposablesImports,
VueRouterAutoImports,
{
"@vueuse/integrations/useSortable": ["useSortable"],
},
],
vueTemplate: true,
}),
// https://github.com/cssninjaStudio/unplugin-fonts
Unfonts({
fontsource: {
families: ["Inter Variable", "Plus Jakarta Sans Variable"],
},
}),
// https://github.com/unjs/unhead
UnheadVite(),
],
// https://github.com/antfu/vite-ssg
ssgOptions,
})