-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvite.config.ts
75 lines (66 loc) · 1.89 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import mdx from "@mdx-js/rollup";
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
import remarkGfm from "remark-gfm";
// @ts-expect-error The plugin is not typed
import veauryVitePlugins from "veaury/vite/esm/index.mjs";
import { defineConfig } from "vite";
import { ViteMinifyPlugin } from "vite-plugin-minify";
import mkcert from "vite-plugin-mkcert";
import { VitePWA } from "vite-plugin-pwa";
import tsconfigPaths from "vite-tsconfig-paths";
import { version } from "./package.json";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
// HTTPS support in development
mkcert({
hosts: ["local.innohassle.ru"],
}),
// Enable routing via TanStack Router
TanStackRouterVite({
routesDirectory: "src/app/routes",
generatedRouteTree: "src/app/route-tree.gen.ts",
quoteStyle: "double",
semicolons: true,
}),
// Support for React and Vue in one project
veauryVitePlugins({
type: "react",
// Configuration of @vitejs/plugin-react
// reactOptions: {...},
// Configuration of @vitejs/plugin-vue
// vueOptions: {...},
// Configuration of @vitejs/plugin-vue-jsx
// vueJsxOptions: {...}
}),
// MDX support
mdx({
remarkPlugins: [remarkGfm],
}),
// Resolve paths from tsconfig.json
tsconfigPaths(),
// Offline mode via PWA
VitePWA({
registerType: "autoUpdate",
workbox: {
clientsClaim: true,
skipWaiting: true,
globPatterns: ["**/*.{js,css,html,json,svg,png,woff2}"],
},
manifest: false, // Manifest is already in public/manifest.json
}),
// Minify the index.html
ViteMinifyPlugin({}),
],
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler",
},
},
},
define: {
// Inject the app version variable
__VERSION__: JSON.stringify(version),
},
});