mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
feat(nuxt-generate): --no-build flag
Much faster generates for when just dynamic routes changed
This commit is contained in:
parent
2385927721
commit
f2663033fc
@ -17,10 +17,11 @@ const argv = parseArgs(process.argv.slice(2), {
|
||||
s: 'spa',
|
||||
u: 'universal'
|
||||
},
|
||||
boolean: ['h', 's', 'u'],
|
||||
boolean: ['h', 's', 'u', 'build'],
|
||||
string: ['c'],
|
||||
default: {
|
||||
c: 'nuxt.config.js'
|
||||
c: 'nuxt.config.js',
|
||||
build: true
|
||||
}
|
||||
})
|
||||
|
||||
@ -36,6 +37,7 @@ if (argv.help) {
|
||||
--universal Launch in Universal mode (default)
|
||||
--config-file, -c Path to Nuxt.js config file (default: nuxt.config.js)
|
||||
--help, -h Displays this message
|
||||
--no-build Just run generate for faster builds when just dynamic routes changed. Nuxt build is needed before this command.
|
||||
`)
|
||||
process.exit(0)
|
||||
}
|
||||
@ -62,7 +64,13 @@ debug('Generating...')
|
||||
const nuxt = new Nuxt(options)
|
||||
const builder = new Builder(nuxt)
|
||||
const generator = new Generator(nuxt, builder)
|
||||
generator.generate()
|
||||
|
||||
const generateOptions = {
|
||||
init: true,
|
||||
build: argv['build']
|
||||
}
|
||||
|
||||
generator.generate(generateOptions)
|
||||
.then(() => {
|
||||
debug('Generate done')
|
||||
process.exit(0)
|
||||
|
Loading…
Reference in New Issue
Block a user