Skip to content

Commit dfcdc91

Browse files
committed
fix: set nitro.static early for GitHub Pages og-image compatibility
Made-with: Cursor
1 parent b7f9a66 commit dfcdc91

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nuxt.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
// https://nuxt.com/docs/api/configuration/nuxt-config
22
// @ts-nocheck — `.nuxt/schema/nuxt.schema.d.ts` can merge `NuxtConfig` as `{}` when only `appConfig` keys are customized; runtime config stays valid.
3+
4+
// Set early so nuxt-og-image resolves `nitro-prerender` compatibility instead of the unknown
5+
// `github-pages` preset (the preset applies `static: true` after some module hooks run).
6+
const isGithubPagesDeploy = process.env.DEPLOY_TARGET === 'github-pages';
7+
38
export default defineNuxtConfig({
49
modules: [
510
'@nuxt/image',
@@ -59,6 +64,7 @@ export default defineNuxtConfig({
5964
compatibilityDate: '2025-10-01',
6065

6166
nitro: {
67+
...(isGithubPagesDeploy ? { static: true } : {}),
6268
prerender: {
6369
// Seed docs so the crawler can follow sidebar/nav links to every page.
6470
routes: ['/', '/docs/getting-started'],

0 commit comments

Comments
 (0)