Skip to content

Commit 593e73c

Browse files
committed
fix: don't await pages if only using app.vue
1 parent 0a10eb9 commit 593e73c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/util/kit.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export {}
6868
}
6969

7070
export function createPagesPromise(nuxt: Nuxt = useNuxt()) {
71+
if (!nuxt.options.pages) {
72+
return Promise.resolve([])
73+
}
7174
return new Promise<NuxtPage[]>((resolve) => {
7275
nuxt.hooks.hook('modules:done', () => {
7376
extendPages(resolve)

test/integration/chunks/generate.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ describe('generate', () => {
66
it('basic', async () => {
77
process.env.NODE_ENV = 'production'
88
process.env.prerender = true
9+
process.env.NITRO_PRESET = 'static'
910
process.env.NUXT_PUBLIC_SITE_URL = 'https://nuxtseo.com'
1011
const { resolve } = createResolver(import.meta.url)
1112
const rootDir = resolve('../../fixtures/chunks')
1213
const nuxt = await loadNuxt({
1314
rootDir,
1415
overrides: {
16+
nitro: {
17+
preset: 'static',
18+
},
1519
_generate: true,
16-
nitro: { static: true },
1720
},
1821
})
1922

0 commit comments

Comments
 (0)