mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
Distinct spa mode to use generate directly
This commit is contained in:
parent
775c9d0850
commit
1507061138
@ -70,22 +70,23 @@ debug('Building...')
|
|||||||
const nuxt = new Nuxt(options)
|
const nuxt = new Nuxt(options)
|
||||||
const builder = new Builder(nuxt)
|
const builder = new Builder(nuxt)
|
||||||
|
|
||||||
builder.build()
|
if (options.mode !== 'spa') {
|
||||||
.then(() => {
|
// Build for SSR app
|
||||||
debug('Building done')
|
builder.build()
|
||||||
if (options.mode === 'spa') {
|
.then(() => debug('Building done'))
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err) // eslint-disable-line no-console
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
// Disable minify to get exact results of nuxt start
|
// Disable minify to get exact results of nuxt start
|
||||||
nuxt.options.generate.minify = false
|
nuxt.options.generate.minify = true
|
||||||
// Generate on SPA mode
|
// Generate on spa mode
|
||||||
return new Generator(nuxt, builder).generate({ build: false, minify: false }).then(() => {
|
new Generator(nuxt, builder).generate({ build: true }).then(() => {
|
||||||
if (!nuxt.options.dev) {
|
if (!nuxt.options.dev) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(`✓ You can now directly upload ${nuxt.options.generate.dir}/ or start server using "nuxt start"`)
|
console.log(`✓ You can now directly upload ${nuxt.options.generate.dir}/ or start server using "nuxt start"`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error(err) // eslint-disable-line no-console
|
|
||||||
process.exit(1)
|
|
||||||
})
|
|
||||||
|
Loading…
Reference in New Issue
Block a user