mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
logs for generator
This commit is contained in:
parent
fdfd7aa32d
commit
ca525200ca
@ -10,6 +10,7 @@ const _ = require('lodash')
|
||||
const { resolve, join, dirname, sep } = require('path')
|
||||
const { minify } = require('html-minifier')
|
||||
const Chalk = require('chalk')
|
||||
const ORA = require('ora')
|
||||
const { printWarn } = require('../common/utils')
|
||||
|
||||
const {
|
||||
@ -34,14 +35,23 @@ module.exports = class Generator {
|
||||
this.distPath,
|
||||
isUrl(this.options.build.publicPath) ? '' : this.options.build.publicPath
|
||||
)
|
||||
|
||||
this.spinner = new ORA()
|
||||
}
|
||||
|
||||
async generate({ build = true, init = true } = {}) {
|
||||
this.spinner.start('Initializing generator...')
|
||||
|
||||
await this.initiate({ build, init })
|
||||
|
||||
this.spinner.start('Preparing routes for generate...')
|
||||
|
||||
const routes = await this.initRoutes()
|
||||
|
||||
this.spinner.start('Generating pages...')
|
||||
|
||||
const errors = await this.generateRoutes(routes)
|
||||
|
||||
await this.afterGenerate()
|
||||
|
||||
// Done hook
|
||||
@ -221,6 +231,8 @@ module.exports = class Generator {
|
||||
const pageErrors = []
|
||||
|
||||
try {
|
||||
this.spinner.info('Generate ' + route)
|
||||
|
||||
const res = await this.nuxt.renderer.renderRoute(route, {
|
||||
_generate: true,
|
||||
payload
|
||||
|
Loading…
Reference in New Issue
Block a user