mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
feat: add --no-generate option
useful for SPA builds that don't need static dist/ to be generated
This commit is contained in:
parent
7d3afb0502
commit
63fe3fd803
@ -29,6 +29,7 @@ if (argv.help) {
|
||||
--analyze, -a Launch webpack-bundle-analyzer to optimize your bundles.
|
||||
--spa Launch in SPA mode
|
||||
--universal Launch in Universal mode (default)
|
||||
--no-generate Don't generate static version for SPA mode (useful for nuxt start)
|
||||
--config-file, -c Path to Nuxt.js config file (default: nuxt.config.js)
|
||||
--help, -h Displays this message
|
||||
`)
|
||||
@ -63,15 +64,16 @@ const close = () => {
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
if (options.mode !== 'spa') {
|
||||
// -- Build only --
|
||||
if (options.mode !== 'spa' || argv.generate === false) {
|
||||
// Build only
|
||||
builder
|
||||
.build()
|
||||
.then(() => close())
|
||||
.catch(error => consola.fatal(error))
|
||||
} else {
|
||||
// Generate dist for SPA static deployment
|
||||
new Generator(nuxt, builder).generate({ build: true }).then(() => {
|
||||
close()
|
||||
})
|
||||
// Build + Generate for static deployment
|
||||
new Generator(nuxt, builder)
|
||||
.generate({ build: true })
|
||||
.then(() => close())
|
||||
.catch(error => consola.fatal(error))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user