-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
67 lines (61 loc) · 1.95 KB
/
Copy pathnuxt.config.ts
File metadata and controls
67 lines (61 loc) · 1.95 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
// https://nuxt.com/docs/api/configuration/nuxt-config
import tailwindcss from "@tailwindcss/vite";
export default defineNuxtConfig({
compatibilityDate: "2025-07-15",
devtools: { enabled: true },
css: ["~/assets/css/main.css"],
vite: {
plugins: [tailwindcss()],
},
modules: ["@nuxt/eslint", "@nuxt/image", "@nuxt/icon", "@nuxtjs/color-mode"],
// Handle service worker routes that should not be processed by Vue Router
nitro: {
routeRules: {
"/firebase-messaging-sw.js": {
headers: { "Content-Type": "application/javascript" },
},
// Add caching for public API routes
"/api/public/**": {
headers: {
"Cache-Control": "public, max-age=300", // 5 minutes cache
"X-Robots-Tag": "noindex",
},
},
// Prerender public routes for better performance
"/public/**": {
ssr: true,
experimentalNoScripts: false,
},
},
},
// Enable experimental features for better performance
experimental: {
payloadExtraction: false, // Disable payload extraction for public routes
},
// Optimize build
build: {
transpile: ["marked"], // Ensure marked is properly transpiled
},
colorMode: {
preference: "system", // default value of $colorMode.preference
fallback: "light", // fallback value if not system preference found
hid: "nuxt-color-mode-script",
globalName: "__NUXT_COLOR_MODE__",
componentName: "ColorScheme",
classPrefix: "",
classSuffix: "",
storageKey: "nuxt-color-mode",
},
runtimeConfig: {
supabaseUrl: process.env.SUPABASE_URL,
supabaseAnonKey: process.env.SUPABASE_ANON_KEY,
awsAccessKeyId: process.env.AWS_ACCESS_KEY_ID,
awsSecretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
awsRegion: process.env.AWS_REGION,
s3BucketName: process.env.S3_BUCKET_NAME,
public: {
supabaseUrl: process.env.SUPABASE_URL,
supabaseAnonKey: process.env.SUPABASE_ANON_KEY,
},
},
});