Nuxt() does not call build() anymore

This commit is contained in:
Sébastien Chopin 2016-12-07 18:47:02 +01:00
parent 495c46040b
commit 43f51c402a

View File

@ -70,22 +70,15 @@ class Nuxt {
this._nuxtRegexp = /^\/_nuxt\//
this.serveStaticNuxt = pify(serveStatic(resolve(this.dir, '.nuxt', 'dist')))
// Add this.build
this.build = build.bind(this)
build.options.call(this) // Add build options
this.build = () => co(build.build.bind(this))
// Add this.render and this.renderRoute
this.render = render.render.bind(this)
this.renderRoute = render.renderRoute.bind(this)
this.renderAndGetWindow = render.renderAndGetWindow.bind(this)
// Add this.generate
this.generate = generate.bind(this)
// Launch build and set this.renderer
return co(this.build)
.then(() => {
if (typeof cb === 'function') cb(null, this)
return this
})
.catch((err) => {
if (typeof cb === 'function') cb(err)
return Promise.reject(err)
})
return this
}
close (callback) {