-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
140 lines (130 loc) · 4.68 KB
/
nuxt.config.ts
File metadata and controls
140 lines (130 loc) · 4.68 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
135
136
137
138
139
140
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2025-07-15',
devtools: { enabled: true },
// TypeScript - include DOM types for scrapers that use page.evaluate()
typescript: {
tsConfig: {
compilerOptions: {
lib: ['ESNext', 'DOM', 'DOM.Iterable'],
},
},
},
// SSR for SEO
ssr: true,
// App configuration
app: {
// Add build hash to asset filenames for cache busting
buildAssetsDir: '/_nuxt/',
head: {
title: 'AroundHere',
htmlAttrs: {
lang: 'en',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'description', content: 'Discover live music events in Western Massachusetts' },
// Open Graph defaults
{ property: 'og:type', content: 'website' },
{ property: 'og:site_name', content: 'AroundHere' },
{ property: 'og:locale', content: 'en_US' },
// Twitter Card defaults
{ name: 'twitter:card', content: 'summary_large_image' },
// Theme color for mobile browsers
{ name: 'theme-color', content: '#111827' },
],
link: [
{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' },
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico', sizes: '48x48' },
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' },
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
{ rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap' },
],
script: [
{
innerHTML: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WDNTCPR6');`,
},
],
noscript: [
{
innerHTML: `<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WDNTCPR6" height="0" width="0" style="display:none;visibility:hidden"></iframe>`,
tagPosition: 'bodyOpen',
},
],
},
},
// Runtime config for environment variables
runtimeConfig: {
// Server-only
databaseUrl: process.env.DATABASE_URL,
emailFrom: process.env.EMAIL_FROM || 'AroundHere <whatsup@aroundhere.live>',
superAdminEmail: process.env.SUPER_ADMIN_EMAIL,
r2AccountId: process.env.R2_ACCOUNT_ID,
r2AccessKeyId: process.env.R2_ACCESS_KEY_ID,
r2SecretAccessKey: process.env.R2_SECRET_ACCESS_KEY,
r2BucketName: process.env.R2_BUCKET_NAME,
r2PublicUrl: process.env.R2_PUBLIC_URL,
// Session configuration for nuxt-auth-utils
// Note: password is set via NUXT_SESSION_PASSWORD env variable at runtime
// @ts-expect-error password is required by SessionConfig but provided via env
session: {
maxAge: 60 * 60 * 24 * 30, // 30 days in seconds
cookie: {
sameSite: 'lax',
},
},
// Public (exposed to client)
public: {
regionName: 'Western Massachusetts',
siteUrl: process.env.NUXT_PUBLIC_SITE_URL || 'https://aroundhere.live',
},
},
modules: ['@nuxt/ui', '@nuxt/ui-pro', '@nuxtjs/mdc', 'nuxt-auth-utils'],
// Force light mode by default
colorMode: {
preference: 'light',
},
// Nuxt UI configuration
ui: {
theme: {
colors: ['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose', 'gray', 'neutral', 'primary', 'secondary', 'success', 'info', 'warning', 'error'],
},
},
// Vite configuration for cache busting
vite: {
build: {
// Generate unique hashes for each build to bust cache
rollupOptions: {
output: {
// Add content hash to chunk filenames
chunkFileNames: '_nuxt/[name].[hash].js',
entryFileNames: '_nuxt/[name].[hash].js',
assetFileNames: '_nuxt/[name].[hash].[ext]',
},
},
},
},
// Nitro configuration for production
nitro: {
compressPublicAssets: true,
// Set cache headers for static assets
routeRules: {
'/_nuxt/**': {
headers: {
'cache-control': 'public, max-age=31536000, immutable', // 1 year for hashed assets
},
},
'/api/**': {
headers: {
'cache-control': 'no-cache, no-store, must-revalidate', // Never cache API
},
},
},
},
})