mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
parent
08d298d35c
commit
c86dfbf43f
@ -28,7 +28,7 @@ export default {
|
||||
alias: 'q',
|
||||
type: 'boolean',
|
||||
description: 'Disable output except for errors',
|
||||
handle(options, argv) {
|
||||
prepare(cmd, options, argv) {
|
||||
// Silence output when using --quiet
|
||||
options.build = options.build || {}
|
||||
if (argv.quiet) {
|
||||
@ -37,12 +37,12 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
async run(nuxtCmd) {
|
||||
const argv = nuxtCmd.getArgv()
|
||||
async run(cmd) {
|
||||
const argv = cmd.getArgv()
|
||||
|
||||
// Create production build when calling `nuxt build` (dev: false)
|
||||
const nuxt = await nuxtCmd.getNuxt(
|
||||
await nuxtCmd.getNuxtConfig(argv, { dev: false })
|
||||
const nuxt = await cmd.getNuxt(
|
||||
await cmd.getNuxtConfig(argv, { dev: false })
|
||||
)
|
||||
|
||||
// Setup hooks
|
||||
@ -51,10 +51,10 @@ export default {
|
||||
let builderOrGenerator
|
||||
if (nuxt.options.mode !== 'spa' || argv.generate === false) {
|
||||
// Build only
|
||||
builderOrGenerator = (await nuxtCmd.getBuilder(nuxt)).build()
|
||||
builderOrGenerator = (await cmd.getBuilder(nuxt)).build()
|
||||
} else {
|
||||
// Build + Generate for static deployment
|
||||
builderOrGenerator = (await nuxtCmd.getGenerator(nuxt)).generate({
|
||||
builderOrGenerator = (await cmd.getGenerator(nuxt)).generate({
|
||||
build: true
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user