diff --git a/lib/renderer.js b/lib/renderer.js index 7f93d4f418..ba93de2195 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -31,6 +31,14 @@ export default class Renderer extends Tapable { // Will be set by createRenderer this.bundleRenderer = null + // Renderer runtime resources + this.resources = { + clientManifest: null, + serverBundle: null, + appTemplate: null, + errorTemplate: parseTemplate(fs.readFileSync(resolve(__dirname, 'views', 'error.html'), 'utf8')) + } + if (nuxt.initialized) { // If nuxt already initialized this._init = this.init().catch(this.nuxt.errorHandler) @@ -48,14 +56,6 @@ export default class Renderer extends Tapable { return this._init } - // Renderer runtime resources - this.resources = { - clientManifest: null, - serverBundle: null, - appTemplate: null, - errorTemplate: parseTemplate(fs.readFileSync(resolve(__dirname, 'views', 'error.html'), 'utf8')) - } - // For serving static/ files to / this.serveStatic = pify(serveStatic(resolve(this.options.srcDir, 'static'), this.options.render.static))