diff --git a/lib/nuxt.js b/lib/nuxt.js index 85658d097c..7e7bc268dc 100644 --- a/lib/nuxt.js +++ b/lib/nuxt.js @@ -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) {