mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
feat: add --quite mode for nuxt-build (#3700)
* feat: add quite mode for nuxt-build * fix: typoe * fix: better description * revert: level change in options
This commit is contained in:
parent
ec52104ec1
commit
04e53b0f9f
@ -10,9 +10,10 @@ const argv = parseArgs(process.argv.slice(2), {
|
|||||||
c: 'config-file',
|
c: 'config-file',
|
||||||
a: 'analyze',
|
a: 'analyze',
|
||||||
s: 'spa',
|
s: 'spa',
|
||||||
u: 'universal'
|
u: 'universal',
|
||||||
|
q: 'quiet'
|
||||||
},
|
},
|
||||||
boolean: ['h', 'a', 's', 'u'],
|
boolean: ['h', 'a', 's', 'u', 'q'],
|
||||||
string: ['c'],
|
string: ['c'],
|
||||||
default: {
|
default: {
|
||||||
c: 'nuxt.config.js'
|
c: 'nuxt.config.js'
|
||||||
@ -27,10 +28,11 @@ if (argv.help) {
|
|||||||
$ nuxt build <dir>
|
$ nuxt build <dir>
|
||||||
Options
|
Options
|
||||||
--analyze, -a Launch webpack-bundle-analyzer to optimize your bundles.
|
--analyze, -a Launch webpack-bundle-analyzer to optimize your bundles.
|
||||||
--spa Launch in SPA mode
|
--spa, -s Launch in SPA mode
|
||||||
--universal Launch in Universal mode (default)
|
--universal, -u Launch in Universal mode (default)
|
||||||
--no-generate Don't generate static version for SPA mode (useful for nuxt start)
|
--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)
|
--config-file, -c Path to Nuxt.js config file (default: nuxt.config.js)
|
||||||
|
--quiet, -q Disable output except for errors
|
||||||
--help, -h Displays this message
|
--help, -h Displays this message
|
||||||
`)
|
`)
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
@ -47,6 +49,12 @@ if (argv.analyze && typeof options.build.analyze !== 'object') {
|
|||||||
options.build.analyze = true
|
options.build.analyze = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Silence output when using --quiet
|
||||||
|
if (argv.quiet) {
|
||||||
|
options.test = true
|
||||||
|
consola.level = 0
|
||||||
|
}
|
||||||
|
|
||||||
const nuxt = new Nuxt(options)
|
const nuxt = new Nuxt(options)
|
||||||
const builder = new Builder(nuxt)
|
const builder = new Builder(nuxt)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user