-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
134 lines (120 loc) · 3.06 KB
/
nuxt.config.ts
File metadata and controls
134 lines (120 loc) · 3.06 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import tailwindcss from "@tailwindcss/vite"
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: "2025-08-16",
devtools: { enabled: true },
// Performance optimizations
nitro: {
compressPublicAssets: true,
prerender: {
crawlLinks: true,
routes: ["/"],
},
routeRules: {
"/": { prerender: true },
"/api/**": { cors: true, headers: { "Access-Control-Allow-Origin": "*" } },
},
},
modules: ["@nuxt/eslint", "@nuxt/icon", "shadcn-nuxt", "@vueuse/nuxt", "@nuxt/image", "@nuxt/scripts", "nuxt-umami"],
// CSS optimization
css: ["~/assets/css/main.css"],
// Build optimization
vite: {
plugins: [tailwindcss()],
build: {
rollupOptions: {
output: {
manualChunks: {
"date-fns": ["date-fns"],
"vue-sonner": ["vue-sonner"],
uuid: ["uuid"],
},
},
},
},
optimizeDeps: {
include: ["date-fns", "vue-sonner", "uuid"],
},
},
umami: {
id: process.env.NUXT_UMAMI_SITE_ID || "",
host: "https://umami.anorebel.net",
autoTrack: true,
proxy: "cloak",
// useDirective: true,
// ignoreLocalhost: true,
// excludeQueryParams: false,
// domains: ['cool-site.app', 'my-space.site'],
// customEndpoint: '/my-custom-endpoint',
// enabled: false,
// logErrors: true,
},
scripts: {
registry: {
rybbitAnalytics: {
scriptInput: {
src: "https://rybbit.anorebel.net/api/script.js",
},
siteId: process.env.NUXT_RYBBIT_SITE_ID || "",
},
},
},
// Runtime config for environment variables
runtimeConfig: {
// Private keys (only available on server-side)
secretKey: process.env.SECRET_KEY,
databaseUrl: process.env.DATABASE_URL,
rybbit: {
siteId: process.env.NUXT_RYBBIT_SITE_ID || "",
},
umami: {
id: process.env.NUXT_UMAMI_SITE_ID || "",
},
// Public keys (exposed to client-side)
public: {
apiBase: process.env.NUXT_PUBLIC_API_BASE || "/api",
enableAnalytics: process.env.NUXT_PUBLIC_ENABLE_ANALYTICS === "true",
version: process.env.npm_package_version || "1.0.0",
},
},
// Security headers
routeRules: {
"/**": {
headers: {
"X-Frame-Options": "DENY",
"X-Content-Type-Options": "nosniff",
"X-XSS-Protection": "1; mode=block",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Referrer-Policy": "strict-origin-when-cross-origin",
},
},
},
// Image optimization
image: {
quality: 80,
format: ["webp", "avif"],
screens: {
xs: 320,
sm: 640,
md: 768,
lg: 1024,
xl: 1280,
xxl: 1536,
},
},
// Component configuration
shadcn: {
prefix: "",
componentDir: "./components/ui",
},
// Experimental features for performance
experimental: {
payloadExtraction: false,
renderJsonPayloads: true,
},
// TypeScript configuration
typescript: {
strict: false,
typeCheck: false,
},
})