Repository navigation
Expand file tree
/
Copy pathvite.config.js
More file actions
54 lines (52 loc) · 1.46 KB
/
Copy pathvite.config.js
File metadata and controls
54 lines (52 loc) · 1.46 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
import path from "path";
import { fileURLToPath } from "url";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import tailwindcss from "@tailwindcss/vite";
import { VitePWA } from "vite-plugin-pwa";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [
react(),
tailwindcss(),
VitePWA({
registerType: "prompt",
strategies: "injectManifest",
srcDir: "src",
filename: "sw.js",
// Keep the existing manifest URL stable for installed applications.
manifest: false,
includeAssets: [],
injectManifest: {
// Fingerprint releases for update detection, without caching the files.
globPatterns: ["**/*.{js,css,html,woff,woff2,svg,png,ico,webmanifest}"],
},
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
chunkSizeWarningLimit: 750,
rollupOptions: {
output: {
manualChunks: {
"vendor-react": ["react", "react-dom", "react-router-dom"],
"vendor-ui": ["@base-ui/react", "lucide-react"],
"vendor-motion": ["framer-motion"],
"vendor-data": ["axios", "dexie", "nanostores"],
"vendor-i18n": ["i18next", "react-i18next"],
"vendor-app": [
"dayjs",
"lodash",
"m3-ripple",
"react-virtuoso",
"sonner",
],
},
},
},
},
});