-
Notifications
You must be signed in to change notification settings - Fork 28
/
vite.config.ts
55 lines (54 loc) · 1.84 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
import { TanStackRouterVite } from "@tanstack/router-plugin/vite"
import react from "@vitejs/plugin-react"
import jotaiDebugLabel from "jotai/babel/plugin-debug-label"
import jotaiReactRefresh from "jotai/babel/plugin-react-refresh"
import { visualizer } from "rollup-plugin-visualizer"
import type { PluginOption } from "vite"
import { defineConfig } from "vite"
import { nodePolyfills } from "vite-plugin-node-polyfills"
import { VitePWA } from "vite-plugin-pwa"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
TanStackRouterVite(),
react({ babel: { plugins: [jotaiDebugLabel, jotaiReactRefresh] } }),
visualizer({ filename: "dist/stats.html" }) as unknown as PluginOption,
// Fixes isomorphic-git Buffer error
// https://github.com/isomorphic-git/isomorphic-git/issues/1753
VitePWA({
strategies: "generateSW",
registerType: "prompt",
injectRegister: "auto",
manifest: {
name: "Lumen",
short_name: "Lumen",
description: "A simple note-taking app for better thinking",
theme_color: "#ffffff",
icons: [
{
src: "icon-1024.png",
sizes: "1024x1024",
type: "image/png",
},
],
start_url: "/",
display: "standalone",
},
workbox: {
globPatterns: ["**/*.{html,css,js,woff2}"],
ignoreURLParametersMatching: [/^utm_/, /^fbclid$/],
skipWaiting: true,
navigateFallback: "index.html",
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, // 5MB
sourcemap: true,
// Do not cache edge function routes
navigateFallbackDenylist: [/cors-proxy/, /git-lfs-file/, /github-auth/],
},
devOptions: {
enabled: process.env.NODE_ENV === "development",
type: "module",
},
}),
nodePolyfills(),
],
})