-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
141 lines (127 loc) Β· 4.37 KB
/
Copy pathnuxt.config.ts
File metadata and controls
141 lines (127 loc) Β· 4.37 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
// Nuxt config β https://nuxt.com/docs/api/configuration/nuxt-config
import { generateContentArtifacts } from './build/generate-content-artifacts'
export default defineNuxtConfig({
modules: [
'@nuxt/eslint',
'@nuxt/image',
'@nuxt/ui',
'@nuxt/content',
'@nuxtjs/seo',
'motion-v/nuxt'
],
css: ['~/assets/css/main.css'],
site: {
url: process.env.NUXT_PUBLIC_SITE_URL || 'https://fmeyer.dev',
name: 'fmeyer.dev',
description: 'Fabian Meyer β Leader, software engineer and AI mentor at eventim Tech. Vue chapter leadership, agentic engineering, and frontend craft.',
defaultLocale: 'en'
},
runtimeConfig: {
public: {
siteUrl: process.env.NUXT_PUBLIC_SITE_URL || 'https://fmeyer.dev',
noindex: process.env.NUXT_PUBLIC_NOINDEX === 'true'
}
},
experimental: {
payloadExtraction: false
},
compatibilityDate: '2025-03-01',
nitro: {
prerender: {
routes: [
'/',
'/404',
'/410'
],
crawlLinks: true
}
},
hooks: {
'nitro:init'(nitro) {
// Resolve __BASE__ in public/.htaccess.tpl using the runtime base URL
// and write the result to .output/public/.htaccess. Templating happens at
// generate time so production (/) and preview (/pr-<n>/) builds each get
// the correct ErrorDocument and RewriteBase paths.
if (nitro.options.dev) return
nitro.hooks.hook('close', async () => {
const { promises: fs } = await import('node:fs')
const { resolve } = await import('node:path')
const baseURL = nitro.options.runtimeConfig.app.baseURL || '/'
const templatePath = resolve(nitro.options.rootDir, 'public/.htaccess.tpl')
const outputDir = nitro.options.output.publicDir
const outputPath = resolve(outputDir, '.htaccess')
const leakedTemplate = resolve(outputDir, '.htaccess.tpl')
try {
const tpl = await fs.readFile(templatePath, 'utf8')
await fs.writeFile(outputPath, tpl.replaceAll('__BASE__', baseURL))
await fs.rm(leakedTemplate, { force: true })
} catch (err) {
if ((err as NodeJS.ErrnoException).code !== 'ENOENT') throw err
}
// Generate llms.txt, llms-full.txt, and rss.xml from YAML content so
// LLM crawlers and feed readers can pick up labs + talks without
// having to render the site.
await generateContentArtifacts(nitro)
})
}
},
eslint: {
config: {
stylistic: {
commaDangle: 'never',
braceStyle: '1tbs'
}
}
},
icon: {
// The build-time scanner only sees static literals. We need to cover:
// - dynamic names in templates (ColorModeButton builds `i-lucide-${...}`)
// - icons referenced inside @nuxt/ui (lives in node_modules, not scanned)
// The default scanner globs cover .vue / .yml / .md etc., but not .ts β
// and several status / nav icons (labs.ts, links.ts, app.config.ts) live
// there. Extend the globs to include .ts (and .mts for safety).
// `fallbackToApi: 'server-only'` keeps SSR/generate-time resolution but
// blocks the runtime `api.iconify.design` request that CSP `connect-src
// 'self'` would otherwise reject.
clientBundle: {
scan: {
globInclude: ['**/*.{vue,jsx,tsx,ts,mts,md,mdc,mdx,yml,yaml}']
},
icons: [
'lucide:sun',
'lucide:moon',
'lucide:arrow-right',
'lucide:arrow-up-right',
'lucide:chevron-down'
]
},
fallbackToApi: 'server-only'
},
robots: {
disallow: [],
sitemap: '/sitemap.xml'
},
schemaOrg: {
identity: {
type: 'Person',
name: 'Fabian Meyer',
url: process.env.NUXT_PUBLIC_SITE_URL || 'https://fmeyer.dev',
image: '/profile/fabian-meyer-portrait.jpg',
description: 'Chapter Lead Vue, software engineer, and AI mentor at eventim Tech. Leads the Vue chapter, provides technical leadership for the Tixx Online Shop, and helps teams apply agentic engineering with measurable customer impact.',
jobTitle: 'Chapter Lead Vue, Software Engineer, AI Mentor',
worksFor: {
'@type': 'Organization',
'name': 'eventim Tech GmbH'
},
sameAs: [
'https://github.com/dinooo13',
'https://linkedin.com/in/fabian-meyer-02038813a'
]
}
},
sitemap: {
autoLastmod: true,
xsl: false,
exclude: ['/404', '/410']
}
})