-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
75 lines (72 loc) · 2.16 KB
/
vite.config.ts
File metadata and controls
75 lines (72 loc) · 2.16 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
import path from "path";
import { cloudflare } from "@cloudflare/vite-plugin";
import { reactRouter } from "@react-router/dev/vite";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
import devtoolsJson from "vite-plugin-devtools-json";
import { VitePWA } from "vite-plugin-pwa";
export const baseConfigurationAlias = {
"@persistence": path.resolve(__dirname, "./src/features/db.server/index.ts"),
"@features": path.resolve(__dirname, "./src/features"),
"@routes": path.resolve(__dirname, "./src/routes"),
"@components": path.resolve(__dirname, "./src/components/"),
"@config/server": path.resolve(__dirname, "./src/config.server.ts"),
"@config": path.resolve(__dirname, "./src/config.ts")
};
export default defineConfig({
logLevel: "info",
clearScreen: false,
plugins: [
cloudflare({ viteEnvironment: { name: "ssr" } }),
tailwindcss(),
reactRouter(),
devtoolsJson(),
VitePWA({
outDir: "build/client",
registerType: "autoUpdate",
injectRegister: false, // registered manually in entry.client.tsx
pwaAssets: {
disabled: false,
config: true
},
manifest: {
id: "/",
name: "BiteRoulette",
short_name: "BiteRoulette",
description: "The lazy way to decide where to eat.",
theme_color: "#c25644",
display: "standalone",
screenshots: [
{
"src": "screenshot-mobile.png",
"sizes": "585x1266",
"type": "image/png",
"form_factor": "narrow",
"label": "Mobile Home Screen"
},
{
"src": "screenshot-desktop.png",
"sizes": "1920x1080",
"type": "image/png",
"form_factor": "wide",
"label": "Desktop Home Screen"
}
]
},
workbox: {
globPatterns: ["**/*.{js,css,html,svg,png,ico}"],
cleanupOutdatedCaches: true,
clientsClaim: true,
navigateFallback: null,
},
devOptions: {
enabled: true,
suppressWarnings: true,
type: "module"
},
}),
],
resolve: {
alias: baseConfigurationAlias
}
});