Skip to content

Commit

Permalink
fix: don't await pages if only using app.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Jan 29, 2025
1 parent 0a10eb9 commit 593e73c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/util/kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ export {}
}

export function createPagesPromise(nuxt: Nuxt = useNuxt()) {
if (!nuxt.options.pages) {
return Promise.resolve([])
}
return new Promise<NuxtPage[]>((resolve) => {
nuxt.hooks.hook('modules:done', () => {
extendPages(resolve)
Expand Down
5 changes: 4 additions & 1 deletion test/integration/chunks/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ describe('generate', () => {
it('basic', async () => {
process.env.NODE_ENV = 'production'
process.env.prerender = true
process.env.NITRO_PRESET = 'static'
process.env.NUXT_PUBLIC_SITE_URL = 'https://nuxtseo.com'
const { resolve } = createResolver(import.meta.url)
const rootDir = resolve('../../fixtures/chunks')
const nuxt = await loadNuxt({
rootDir,
overrides: {
nitro: {
preset: 'static',
},
_generate: true,
nitro: { static: true },
},
})

Expand Down

0 comments on commit 593e73c

Please sign in to comment.