-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
694 lines (654 loc) · 24.1 KB
/
Copy pathnuxt.config.ts
File metadata and controls
694 lines (654 loc) · 24.1 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
import type { SitemapUrl } from './nitro/fetch-routes'
import { fileURLToPath } from 'node:url'
import process from 'process'
import monacoEditorPlugin from 'vite-plugin-monaco-editor'
import fetchRoutes from './nitro/fetch-routes'
// Only fetch routes when actually building/generating - not during `nuxi prepare`, type-gen, etc.
const isBuildCommand = process.argv.some(arg => ['build', 'generate'].includes(arg))
// Cache the fetch result so it's only called once across hooks
let fetchRoutesCache: Promise<{ routes: string[], sitemapUrls: SitemapUrl[] }> | null = null
async function getCachedRoutes() {
fetchRoutesCache ??= fetchRoutes()
return fetchRoutesCache
}
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
routeRules: {
'/admin/**': { ogImage: false },
'/auth/**': { ogImage: false },
'/profile/**': { ogImage: false },
'/playground/**': { ogImage: false },
'/votes/**': { ogImage: false },
},
alias: {
'@': fileURLToPath(new URL('./app', import.meta.url)),
'~': fileURLToPath(new URL('.', import.meta.url)),
'~~': fileURLToPath(new URL('.', import.meta.url)),
},
app: {
head: {
link: [
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png', sizes: '180x180' },
{ rel: 'manifest', href: '/manifest.json' },
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
{ rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;700&display=swap' },
],
meta: [
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
],
script: [
{
// Blocking inline script - runs synchronously before first paint to
// restore the cached theme and light/dark mode from localStorage,
// preventing any flash of the wrong theme/palette.
innerHTML: `(function () {
try {
// 1. Restore light/dark mode (VUI stores this under 'vueuse-color-scheme')
var scheme = localStorage.getItem('vueuse-color-scheme');
var html = document.documentElement;
if (scheme === 'light') {
html.classList.remove('dark');
html.classList.add('light');
} else {
// Default to dark
html.classList.remove('light');
html.classList.add('dark');
}
// 2. Restore custom theme palette from cache
var raw = localStorage.getItem('hivecom-theme-cache');
if (!raw) return;
var theme = JSON.parse(raw);
if (!theme || !theme.id) return;
var style = html.style;
// Color vars: DB columns like 'dark_bg_raised' -> '--dark-color-bg-raised'
var colorKeys = [
'bg','bg_medium','bg_raised','bg_lowered',
'text','text_light','text_lighter','text_lightest','text_invert',
'text_red','text_green','text_yellow','text_blue',
'bg_red_lowered','bg_red_raised',
'bg_green_lowered','bg_green_raised',
'bg_yellow_lowered','bg_yellow_raised',
'bg_blue_lowered','bg_blue_raised',
'text_purple',
'bg_purple_lowered','bg_purple_raised',
'border','border_strong','border_weak',
'button_gray','button_gray_hover','button_fill','button_fill_hover',
'accent','bg_accent_lowered','bg_accent_raised'
];
for (var i = 0; i < colorKeys.length; i++) {
var k = colorKeys[i];
for (var pi = 0; pi < 2; pi++) {
var prefix = pi === 0 ? 'dark' : 'light';
var col = prefix + '_' + k;
if (theme[col] != null) {
var varName = '--' + prefix + '-color-' + k.replace(/_/g, '-');
style.setProperty(varName, theme[col]);
}
}
}
// Scale helpers
function scaleVal(def, dbVal, minP, maxP) {
var pct = minP + (dbVal / 100) * (maxP - minP);
return def * (pct / 100);
}
// Spacing tokens (minPercent=0, maxPercent=200, defaultDb=50, unit=px)
var spacingDefs = [
['--space-xxs', 4], ['--space-xs', 8], ['--space-s', 12],
['--space-m', 16], ['--space-l', 24], ['--space-xl', 34],
['--space-xxl', 48], ['--space-xxxl', 64]
];
var spacingDb = theme.spacing != null ? theme.spacing : 50;
for (var j = 0; j < spacingDefs.length; j++) {
var scaled = scaleVal(spacingDefs[j][1], spacingDb, 0, 200);
style.setProperty(spacingDefs[j][0], Math.round(scaled * 10) / 10 + 'px');
}
// Rounding tokens (minPercent=0, maxPercent=500, defaultDb=20, unit=px)
var roundingDefs = [
['--border-radius-xs', 3], ['--border-radius-s', 5],
['--border-radius-m', 8], ['--border-radius-l', 12],
['--border-radius-pill', 99]
];
var roundingDb = theme.rounding != null ? theme.rounding : 20;
for (var j = 0; j < roundingDefs.length; j++) {
var scaled = scaleVal(roundingDefs[j][1], roundingDb, 0, 500);
style.setProperty(roundingDefs[j][0], Math.round(scaled * 10) / 10 + 'px');
}
// Transition tokens (minPercent=0, maxPercent=400, defaultDb=25, unit=s)
var transitionDefs = [
['--transition-fast', 0.05, 'ease-in-out', '--transition-fast-duration'],
['--transition', 0.11, 'cubic-bezier(.65, 0, .35, 1)', '--transition-duration'],
['--transition-slow', 0.25, 'cubic-bezier(.65, 0, .35, 1)', '--transition-slow-duration']
];
var transitionsDb = theme.transitions != null ? theme.transitions : 25;
for (var j = 0; j < transitionDefs.length; j++) {
var td = transitionDefs[j];
var dur = scaleVal(td[1], transitionsDb, 0, 400);
var durStr = Math.round(dur * 1000) / 1000 + 's';
style.setProperty(td[0], durStr + ' all ' + td[2]);
style.setProperty(td[3], durStr);
}
// Widening/container tokens (minPercent=100, maxPercent=300, defaultDb=0, unit=px)
var containerDefs = [
['--container-xs', 360], ['--container-s', 728], ['--container-m', 968],
['--container-l', 1280], ['--container-xl', 1540], ['--container-xxl', 1920]
];
var wideningDb = theme.widening != null ? theme.widening : 0;
for (var j = 0; j < containerDefs.length; j++) {
var scaled = scaleVal(containerDefs[j][1], wideningDb, 100, 300);
style.setProperty(containerDefs[j][0], Math.round(scaled * 10) / 10 + 'px');
}
} catch (e) {
// Never block the page on theme restore errors
}
})();`,
type: 'text/javascript',
tagPriority: 'critical',
},
{
// Vue-independent boot watchdog. If hydration crashes, app.vue's
// onMounted never runs, so the in-app escape hatch timer in
// Loading.vue never starts and the SSR-rendered splash sits frozen
// with no way out. A plain setTimeout registered here still fires (a
// thrown hydration error frees the main thread), so we can detect the
// stuck splash and offer a reload. The 12s delay clears the 8s
// self-recovery in Loading.vue, so this only triggers on a real boot
// failure, not a slow-but-alive load.
innerHTML: `(function () {
try {
// Only conclude a stuck boot after 12s of CONTINUOUS foreground time. A
// backgrounded tab throttles timers and defers hydration, so wall-clock
// elapsed isn't a reliable signal - it would flag a slow-but-alive load
// that finishes the instant the tab is refocused. Count visible time only,
// and skip an overlay that's already fading out (i.e. recovering).
var DELAY = 12000;
var timer = null;
var shown = false;
function show() {
timer = null;
if (shown) return;
// Overlay gone, or mid fade-out -> the app booted, nothing is stuck.
if (!document.querySelector('.initial-loading:not(.fade-out)')) return;
if (document.getElementById('boot-escape-hatch')) return;
shown = true;
var wrap = document.createElement('div');
wrap.id = 'boot-escape-hatch';
wrap.style.cssText = 'position:fixed;left:50%;bottom:34px;transform:translateX(-50%);z-index:10000;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;font-family:sans-serif;';
var msg = document.createElement('p');
msg.textContent = 'Taking longer than expected...';
msg.style.cssText = 'margin:0;font-size:12px;color:var(--color-text-lighter,#888);';
var row = document.createElement('div');
row.style.cssText = 'display:flex;gap:8px;';
var reload = document.createElement('button');
reload.textContent = 'Reload';
reload.style.cssText = 'cursor:pointer;border:0;border-radius:var(--border-radius-m,8px);padding:6px 14px;font-size:13px;background:var(--color-accent,#a3e635);color:#000;';
reload.onclick = function () {
// Cache-busting reload: a plain location.reload() can be served the
// same stale HTML (which references now-deleted _nuxt chunks), so this
// would never recover. Append a query param to force a network fetch.
var loc = window.location;
var sep = loc.search ? '&' : '?';
loc.replace(loc.pathname + loc.search + sep + '_=' + Date.now() + loc.hash);
};
var support = document.createElement('a');
support.textContent = 'Contact Support';
support.href = 'mailto:contact@hivecom.net';
support.style.cssText = 'display:inline-flex;align-items:center;border-radius:var(--border-radius-m,8px);padding:6px 14px;font-size:13px;color:var(--color-accent,#a3e635);text-decoration:none;';
row.appendChild(reload);
row.appendChild(support);
wrap.appendChild(msg);
wrap.appendChild(row);
(document.body || document.documentElement).appendChild(wrap);
}
function arm() {
if (shown || timer) return;
timer = setTimeout(show, DELAY);
}
function disarm() {
if (timer) { clearTimeout(timer); timer = null; }
}
// Pause the countdown while hidden, start a fresh 12s when refocused, so
// only uninterrupted foreground time counts toward "stuck".
document.addEventListener('visibilitychange', function () {
if (document.visibilityState === 'visible') arm();
else disarm();
});
if (document.visibilityState === 'visible') arm();
} catch (e) {
// Never let the watchdog itself break the page.
}
})();`,
type: 'text/javascript',
},
],
},
pageTransition: {
name: 'page',
},
// layoutTransition: {
// name: 'layout',
// mode: 'out-in',
// },
},
devtools: {
enabled: false,
},
components: false,
compatibilityDate: '2024-09-25',
typescript: {
typeCheck: false,
},
modules: [
'@nuxt/fonts',
'@nuxtjs/supabase',
'@nuxtjs/sitemap',
'@nuxtjs/robots',
'@nuxtjs/seo',
'@nuxt/content',
'@nuxt/image',
'@nuxt/icon',
'nuxt-og-image',
'@pinia/nuxt',
'@vueuse/nuxt',
'@nuxtjs/mdc',
'@yuta-inoue-ph/nuxt-vcalendar',
],
icon: {
serverBundle: 'remote',
clientBundle: {
scan: true,
sizeLimitKb: 512,
// Icons referenced dynamically (via :name binding from JS objects/constants) -
// can't be statically scanned from templates, so must be explicitly included.
icons: [
// constants.json PLATFORMS (index.vue join section)
'ph:chats-circle-bold',
'ph:play-circle-bold',
'mdi:teamspeak',
// constants.json LINKS (Footer.vue social links)
'mdi:discord',
'mdi:github',
'mdi:code',
'mdi:steam',
'mdi:twitch',
// lib/navigation.ts (Navigation.vue mobile menu)
'ph:house',
'ph:users',
'ph:calendar',
'ph:chats-circle',
'ph:game-controller',
'ph:check-square',
// layouts/admin.vue sidebar menu items
'ph:squares-four',
'ph:images-square',
'ph:flag',
'ph:chat-circle',
'ph:calendar-blank',
'ph:coins',
'ph:database',
'ph:speaker-simple-high',
'ph:computer-tower',
'ph:folder',
'ph:user-sound',
'ph:user',
// Admin/Alerts.vue
'ph:warning-circle',
'ph:calendar-x',
'ph:warning-octagon',
// Admin/Complaints (ComplaintCard.vue, ComplaintDetails.vue)
'ph:bell',
'ph:check-circle',
'ph:chat-circle-dots',
'ph:question',
'ph:chat-circle-text',
'ph:chats',
// Admin/Discussions/DiscussionDetails.vue context links
'ph:user-circle',
// Admin/Network/GameServerTable.vue
'ph:cube',
// Admin/Users/UserTable.vue provider + platform icons
'ph:google-logo',
'ph:discord-logo',
// Chat/MessageLog.vue bridgeInfo() - relay source icons (dynamic :name binding)
'ph:telegram-logo',
'simple-icons:matrix',
// ph:discord-logo already listed above
// ph:swap already scanned statically
'ph:envelope-simple',
'ph:identification-card',
'ph:steam-logo',
'ph:patreon-logo',
// Editor/RichTextSelectionMenu.vue
// (static string names in <Icon> - included explicitly to guarantee bundle inclusion)
'ph:text-h-one',
'ph:x',
'ph:text-b',
'ph:text-italic',
'ph:text-underline',
'ph:text-strikethrough',
'ph:code',
'ph:paint-bucket',
'ph:text-aa',
'ph:list-bullets',
'ph:list-numbers',
'ph:code-block',
'ph:quotes',
'material-symbols-light:lowercase',
// Community/FundingHistory.vue growth indicators
'ph:minus',
'ph:trend-up',
'ph:trend-down',
// pages/servers/gameservers/[id].vue state configs
'ph:check-circle-fill',
'ph:play-circle-fill',
'ph:warning-circle-fill',
'ph:x-circle-fill',
'ph:question-fill',
// events
'ph:arrows-vertical',
'ph:download-simple',
// Notifications/NotificationTabSubscriptions.vue subscription entity icons
'ph:desktop-tower',
'ph:blueprint',
'ph:scales',
'ph:chat-dots',
'ph:paint-brush',
// Discussions/DiscussionTimeline.vue jump-to-date button + toolbar
'ph:clock',
'ph:arrow-down',
'ph:arrow-up',
// Profile/Banner editor
'ph:arrows-out',
'ph:circle-half-tilt',
'ph:copy',
'ph:floppy-disk',
'ph:folder-open',
'ph:frame-corners',
'ph:image',
'ph:pencil-simple',
'ph:plus',
'ph:selection-foreground',
'ph:text-t',
'ph:trash',
// Global search + searches
'ph:magnifying-glass',
'ph:list-magnifying-glass',
'ph:selection-slash',
'ph:arrow-square-out',
],
},
},
css: [
'@/assets/index.scss',
'katex/dist/katex.min.css',
],
mdc: {
remarkPlugins: {
'remark-math': {},
},
rehypePlugins: {
'rehype-katex': {
options: {
throwOnError: false,
output: 'html',
},
},
// NOTE: rehype-sanitize is configured in mdc.config.ts instead of here.
// nuxt.config.ts options are passed through JSON.stringify when generating
// .nuxt/mdc-imports.mjs, which silently converts every RegExp to {} -
// causing the iframe src allow-list to reject all YouTube embeds.
// mdc.config.ts is loaded as a real ES module so RegExp values survive.
},
},
vite: {
css: {
preprocessorOptions: {
scss: {
additionalData: `@use '@/assets/breakpoints.scss' as *;\n`,
},
},
},
plugins: [
monacoEditorPlugin({ languageWorkers: ['editorWorkerService', 'css'] }),
],
build: {
rollupOptions: {
// consola imports node:tty for its terminal reporter; it's safely
// externalized by Vite and has no effect in the browser. Suppress
// the spurious warning so build output stays readable.
onwarn(warning, warn) {
if (warning.code === 'MODULE_LEVEL_DIRECTIVE')
return
if (
warning.code === 'PLUGIN_WARNING'
&& warning.message.includes('node:tty')
) {
return
}
warn(warning)
},
},
},
optimizeDeps: {
// Caused call-stack exceeded errors
exclude: [
'monaco-editor',
],
include: [
'debug', // CJS
'@dolanske/vui',
'dayjs', // CJS
'dayjs/plugin/relativeTime', // CJS
'@dolanske/v-valid',
'@tiptap/core',
'@tiptap/extension-details',
'@tiptap/extension-image',
'@tiptap/extension-mathematics',
'@tiptap/extension-table/cell',
'@tiptap/extension-table/header',
'@tiptap/extension-table/row',
'@tiptap/extension-table/table',
'@tiptap/extension-task-item',
'@tiptap/extension-task-list',
'@tiptap/extension-youtube',
'@tiptap/extensions',
'@tiptap/markdown',
'@tiptap/pm/state',
'@tiptap/starter-kit',
'@tiptap/vue-3',
'marked',
'@tiptap/vue-3/menus',
'@tiptap/pm/view',
'@tiptap/extension-mention',
'@floating-ui/dom',
'globe.gl',
'h3-js',
'three',
'three/examples/jsm/postprocessing/AfterimagePass.js',
'three/examples/jsm/postprocessing/OutputPass.js',
'three/examples/jsm/postprocessing/ShaderPass.js',
'three/examples/jsm/postprocessing/UnrealBloomPass.js',
'ansi-to-html', // CJS
'jszip', // CJS
'remark-math',
'rehype-katex',
'vue-advanced-cropper',
'chart.js',
'vue-chartjs',
'chartjs-scale-timestack',
'v-calendar',
'@unhead/schema-org/vue',
'@shikijs/engine-oniguruma',
'@shikijs/engine-javascript',
'@shikijs/core',
'@shikijs/transformers',
'@shikijs/langs/javascript',
'@shikijs/langs/jsx',
'@shikijs/langs/json',
'@shikijs/langs/typescript',
'@shikijs/langs/tsx',
'@shikijs/langs/vue',
'@shikijs/langs/css',
'@shikijs/langs/html',
'@shikijs/langs/shellscript',
'@shikijs/langs/markdown',
'@shikijs/langs/mdc',
'@shikijs/langs/yaml',
'@shikijs/themes/github-light',
'@shikijs/themes/github-dark',
'shiki/wasm',
],
},
},
runtimeConfig: {
public: {
patreonClientId: process.env.NUXT_PUBLIC_AUTH_EXTERNAL_PATREON_CLIENT_ID ?? '',
baseUrl: process.env.NUXT_PUBLIC_BASE_URL ?? 'https://hivecom.net',
supabaseProjectRef: process.env.NUXT_PUBLIC_SUPABASE_PROJECT_REF ?? '',
// VAPID application server key (URL-safe base64) for Web Push subscriptions.
vapidPublicKey: process.env.NUXT_PUBLIC_VAPID_PUBLIC_KEY ?? '',
// Orbit Depot storage gateway base URL.
depotUrl: process.env.NUXT_PUBLIC_DEPOT_URL ?? 'https://depot.hivecom.net',
},
},
robots: {
sitemap: [
`${process.env.NUXT_PUBLIC_BASE_URL ?? 'https://hivecom.net'}/sitemap.xml`,
],
groups: [
{
userAgent: '*',
allow: '/',
disallow: ['/admin', '/admin/', '/auth', '/auth/', '/playground', '/playground/', '/profile', '/profile/', '/votes', '/votes/'],
},
],
},
sitemap: {
zeroRuntime: true,
exclude: ['/admin/**', '/auth/**', '/playground/**', '/votes/**'],
urls: async () => {
if (!isBuildCommand) {
return []
}
const { sitemapUrls } = await getCachedRoutes()
return sitemapUrls
},
},
hooks: {
'vite:extendConfig': (config) => {
// `@` resolves to `./app`, but `@/types/*` files live at the repo root
// (`./types`). Nuxt registers the default `@` alias before any we add via
// `alias`, so Vite (and vite-node, used by the dev server) matches `@`
// first and fails to resolve runtime value imports of `@/types/*`.
// Prepend a more specific alias so it is matched first. Vite does not read
// tsconfig `paths`, so this must live in the Vite resolver explicitly.
const typesReplacement = `${fileURLToPath(new URL('./types', import.meta.url))}/`
const resolve = config.resolve
if (!resolve)
return
interface AliasEntry { find: string | RegExp, replacement: string }
const current = resolve.alias
const entries: AliasEntry[] = Array.isArray(current)
? (current as AliasEntry[])
: Object.entries((current ?? {}) as Record<string, string>).map(([find, replacement]) => ({ find, replacement }))
resolve.alias = [
{ find: /^@\/types\//, replacement: typesReplacement },
...entries,
]
},
'nitro:build:before': (nitro) => {
// Force-exit after Nitro fully closes (post-prerender) so the CI process
// doesn't hang on open handles (native addons, etc.) in static builds.
nitro.hooks.hook('close', () => {
if (isBuildCommand) {
process.exit(0)
}
})
},
'nitro:config': async (nitroConfig) => {
if (!isBuildCommand) {
return
}
const { routes } = await getCachedRoutes()
if (nitroConfig.prerender && nitroConfig.prerender.routes) {
nitroConfig.prerender.routes.push(...routes)
}
},
},
fonts: {
families: [
// Inter is the primary Latin font for the OG image templates.
{ name: 'Inter', weights: [400, 700], provider: 'google' },
// Noto Sans SC covers Chinese (simplified + traditional) and other Unicode
// scripts not covered by Inter, giving OG image templates CJK fallback support.
{ name: 'Noto Sans SC', weights: [400, 700], provider: 'google' },
//
// No `global: true`: nuxt-og-image auto-detects these families from the
// font-family declared in the OG image components and resolves them via
// @nuxt/fonts at render time. Setting global would inject a ~200 kB
// nuxt-fonts-global.css of @font-face rules into every app page.
],
experimental: {
// Don't generate metric-adjusted local fallback @font-face rules for the
// font-family declarations found in app/VUI CSS; those overrides change the
// app's system fonts. We only want the OG image renderer to use this font.
disableLocalFallbacks: true,
},
},
ogImage: {
// This is a fully prerendered static site (github-pages), so all OG images
// are generated at build time. Zero runtime mode removes all renderer code
// from the Nitro output and eliminates the "Unknown Nitro preset" warning.
zeroRuntime: true,
// Cache rendered OG images to disk so CI builds skip re-rendering unchanged images.
// Stored in node_modules/.cache/nuxt-seo/og-image/ and preserved by the cache action.
buildCache: true,
},
nitro: {
// Explicitly set static: true so nuxt-og-image's resolveOgImagePreset()
// sees nuxt.options.nitro.static and returns "nitro-prerender" instead of
// falling through to resolveNitroPreset() with an unknown preset name.
static: true,
prerender: {
failOnError: false,
crawlLinks: true,
routes: ['/', '/robots.txt', '/sitemap.xml', '/llms.txt'],
ignore: ['/auth/callback', '/auth/oauth', '/auth/confirm', '/auth/confirm-password'],
},
},
supabase: {
url: process.env.SUPABASE_URL,
key: process.env.SUPABASE_PUBLISHABLE_KEY,
types: '~~/types/database.types.ts',
redirect: false, // It would make sense to have redirects based on the path, however due to SSR, this is not possible.
redirectOptions: {
login: '/auth/sign-in',
callback: '/auth/confirm',
},
// types: './types/database.types.ts',
clientOptions: {
auth: {
// Opt in to the experimental passkey (WebAuthn) API in supabase-js.
experimental: { passkey: true },
},
},
},
site: {
url: process.env.NUXT_PUBLIC_BASE_URL ?? 'https://hivecom.net',
name: 'Hivecom',
title: 'Hivecom',
description: 'A community of friends from all around the world, creating a space for everyone and projects to thrive. We host game servers, provide communication platforms, and foster collaboration through open source projects. Join us!',
tags: [
'community',
'gameservers',
'projects',
'open source',
'gaming',
'irc',
'teamspeak',
'discord',
'forum',
'server network',
],
},
})