-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnuxt.config.ts
152 lines (140 loc) · 3.65 KB
/
nuxt.config.ts
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
import { generateSitemap } from './generateSitemap'
import { breakpoints } from './tailwind.config'
/** @temp fix @see https://github.com/pi0/nuxt-shiki/issues/41#issuecomment-2401330248 */
import { rollup as unwasm } from 'unwasm/plugin'
export default defineNuxtConfig({
compatibilityDate: '2024-12-23',
experimental: {
typedPages: true,
componentIslands: true,
inlineRouteRules: true,
},
typescript: {
shim: false,
},
nitro: {
experimental: {
/** @see https://github.com/pi0/nuxt-shiki/issues/29 inject onig.wasm warning */
wasm: true,
},
/** @see https://github.com/pi0/nuxt-shiki/issues/45 cannot find module core.mjs */
externals: { traceInclude: ['./node_modules/vue/server-renderer', 'shiki/dist/core.mjs'] },
// @nuxtseo/module
prerender: {
crawlLinks: true,
routes: ['/'],
},
},
vite: {
/** @see fix https://github.com/pi0/nuxt-shiki/issues/41 [vite:wasm-fallback] Could not load */
plugins: import.meta.env.NODE_ENV === 'production' ? [unwasm({})] : undefined,
},
runtimeConfig: {
turnstile: {
secretKey: process.env.NUXT_TURNSTILE_SECRET_KEY,
},
gqlHost: process.env.NUXT_GQL_HOST,
gqlToken: process.env.NUXT_GQL_TOKEN,
public: {
siteUrl: process.env.NUXT_PUBLIC_SITE_URL,
siteUrlProd: process.env.NUXT_PUBLIC_SITE_URL_PROD,
isProduction: process.env.NODE_ENV === 'production',
isVercelProduction: process.env.VERCEL_ENV === 'production',
calcomUrl: process.env.NUXT_PUBLIC_CALCOM_URL,
openpanelClientId: process.env.NUXT_PUBLIC_OPENPANEL_CLIENT_ID,
},
},
app: {
head: {
titleTemplate: `${process.env.NODE_ENV === 'development' ? '⚙️ ' : ''}%s %separator %siteName`,
templateParams: {
separator: '·',
},
link: [
// Favicons
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{
rel: 'icon',
type: 'image/png',
href: '/favicon-16x16.png',
sizes: '16x16.png',
},
{
rel: 'icon',
type: 'image/png',
href: '/favicon-32x32.png',
sizes: '32x32.png',
},
{
rel: 'apple-touch-icon',
href: '/apple-touch-icon.png',
sizes: '180x180',
},
],
},
pageTransition: { name: 'page', mode: 'out-in' },
},
modules: [
'@nuxt/image',
'@nuxtjs/seo',
'@vueuse/nuxt',
'@nuxtjs/tailwindcss',
'@nuxtjs/turnstile',
'nuxt-graphql-middleware',
'nuxt-shiki',
],
// @nuxt/image
image: {
screens: breakpoints,
domains: [process.env.NUXT_PUBLIC_WP_HOST || '', 'secure.gravatar.com'],
},
// @nuxtseo/module
site: {
siteUrl: process.env.NUXT_PUBLIC_SITE_URL,
siteName: 'Fabian Beer',
siteDescription:
'Hej! I am Fabian, a visual product designer and frontend developer, creating high-quality web experiences for your unique needs.',
defaultLocale: 'en-US',
},
// @nuxtseo/module->nuxt-og-omage
ogImage: {
enabled: false,
},
// nuxt-link-checker
linkChecker: {
enabled: false,
failOnError: false,
},
// @nuxtjs/sitemap
sitemap: {
autoLastmod: true,
exclude: ['/impressum', '/datenschutz'],
urls: generateSitemap,
},
// @nuxtjs/turnstile
turnstile: {
siteKey: process.env.NUXT_PUBLIC_TURNSTILE_SITE_KEY || '',
},
// nuxt-graphql-middleware
graphqlMiddleware: {
graphqlEndpoint: process.env.NUXT_GQL_HOST,
codegenConfig: {
// disabled so it generates every type from the schema (not only the ones used in operations).
onlyOperationTypes: false,
},
codegenSchemaConfig: {
urlSchemaOptions: {
headers: {
'Authorization': process.env.NUXT_GQL_TOKEN || '',
},
},
},
},
// nuxt-shiki
shiki: {
defaultTheme: 'github-light',
defaultLang: 'typescript',
bundledThemes: [],
bundledLangs: ['typescript', 'html', 'bash', 'php', 'graphql'],
},
})