Skip to content

Commit

Permalink
fix: disable the usage of nuxt generate
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Aug 26, 2024
1 parent 956cc01 commit fb578ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ export default defineNuxtModule<ModuleOptions>({
},
defaults: {},
async setup(options, nuxt) {
// Cannot be used with `nuxt generate`
if (nuxt.options._generate) {
log.error('NuxtHub is not compatible with `nuxt generate` as it needs a server to run.')
log.info('To pre-render all pages: `https://hub.nuxt.com/docs/recipes/pre-rendering#pre-render-all-pages`')
return process.exit(1)
}

const rootDir = nuxt.options.rootDir
const { resolve } = createResolver(import.meta.url)

Expand Down

0 comments on commit fb578ac

Please sign in to comment.