2022-04-20 19:22:59 +00:00
|
|
|
import consola from 'consola'
|
2022-04-07 11:28:04 +00:00
|
|
|
import buildCommand from './build'
|
2021-10-12 08:52:28 +00:00
|
|
|
import { defineNuxtCommand } from './index'
|
|
|
|
|
|
|
|
export default defineNuxtCommand({
|
|
|
|
meta: {
|
|
|
|
name: 'generate',
|
|
|
|
usage: 'npx nuxi generate [rootDir]',
|
2022-04-07 11:28:04 +00:00
|
|
|
description: 'Build Nuxt and prerender static routes'
|
2021-10-12 08:52:28 +00:00
|
|
|
},
|
|
|
|
async invoke (args) {
|
2022-04-07 11:28:04 +00:00
|
|
|
args.prerender = true
|
|
|
|
await buildCommand.invoke(args)
|
2022-04-20 19:22:59 +00:00
|
|
|
consola.success('You can now deploy `.output/public` to any static hosting!')
|
2021-10-12 08:52:28 +00:00
|
|
|
}
|
|
|
|
})
|