-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
178 lines (174 loc) · 3.89 KB
/
nuxt.config.ts
File metadata and controls
178 lines (174 loc) · 3.89 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
import tailwindcss from '@tailwindcss/vite'
import type { NuxtPage } from 'nuxt/schema'
export default defineNuxtConfig({
compatibilityDate: '2025-07-20',
srcDir: 'src/',
devtools: {
enabled: true,
timeline: {
enabled: true,
},
},
modules: [
'@nuxt/icon',
'@nuxt/fonts',
'@nuxt/image',
'@nuxt/content',
'@nuxtjs/sitemap',
'@nuxtjs/mdc',
'@nuxtjs/plausible',
'@nuxtjs/turnstile',
'@vueuse/nuxt',
'nuxt-og-image',
'nuxt-site-config',
'@nuxt/scripts',
],
css: ['~/assets/css/main.css'],
app: {
head: {
title: 'Blueprint',
htmlAttrs: {
lang: 'en',
},
script: [
{
src: 'https://tally.so/widgets/embed.js',
},
],
},
},
sitemap: {
sitemapsPathPrefix: '/',
zeroRuntime: true,
},
ogImage: {
fonts: [
'Roboto:400',
'Roboto:700',
'Funnel+Display:400',
'Funnel+Display:700',
],
zeroRuntime: true,
},
icon: {
localApiEndpoint: '/__nuxt_icon',
},
imports: {
dirs: ['types/**/*.ts', 'types/**/*.d.ts'],
},
vite: {
plugins: [tailwindcss()],
optimizeDeps: {
include: ['debug'],
},
},
components: {
dirs: [
{
path: '~/components/prose',
global: true,
},
'~/components',
],
},
content: {
build: {
markdown: {
highlight: {
theme: 'github-dark',
langs: [
'json',
'js',
'ts',
'tsx',
'html',
'css',
'vue',
'shell',
'md',
'yaml',
'diff',
'php',
],
},
},
},
},
mdc: {
components: {
prose: true,
},
},
site: {
url: 'https://blueprint.zip',
name: 'Blueprint',
},
nitro: {
devProxy: {
'/api': {
// Change to https://blueprint.zip/api to use the production API
// Local API is http://localhost:8000/api
target: 'http://localhost:8000/api',
changeOrigin: true,
},
// You shouldn't really need the sitemap in development, but if you
// really want it, and can't be arsed to make it accurate, you may
// change this to https://blueprint.zip/browse/sitemap.xml, though
// make sure to set "changeOrigin" to true.
'/browse/sitemap.xml': 'http://localhost:8000/browse/sitemap.xml',
},
routeRules: {
'/api/**': {
prerender: false,
headers: { 'cache-control': 'no-cache' },
},
'/browse/**': {
prerender: false,
},
},
},
routeRules: {
'/__og-image__/image/**': {
proxy: { to: '/__og-image__/static/**' },
},
},
plausible: {
apiHost: 'https://plausible.prpl.wtf',
domain: 'blueprint.zip',
autoOutboundTracking: true,
ignoredHostnames: ['localhost'],
},
turnstile: {
siteKey: process.env.TURNSTILE_PUBLIC || '0x4AAAAAAB7bNfQex8uoMyq6',
},
hooks: {
'nitro:build:public-assets': async (nitro) => {
if (nitro.options.preset === 'static') {
const { promises: fs } = await import('fs')
const { join } = await import('path')
const publicDir = nitro.options.output.publicDir
const srcPath = join(publicDir, '__og-image__', 'static')
const destPath = join(publicDir, '__og-image__', 'image')
try {
await fs.cp(srcPath, destPath, { recursive: true })
} catch (err) {
console.warn('og-image copy failed:', err)
}
}
},
'pages:extend'(pages) {
function setMiddleware(pages: NuxtPage[]) {
for (const page of pages) {
page.meta ||= {}
if (!page.meta.middleware) {
page.meta.middleware = ['default']
}
if (page.children) {
setMiddleware(page.children)
}
}
}
setMiddleware(pages)
},
},
})