From 6178527177ca633570d010fb35c7bfb6a4174ecc Mon Sep 17 00:00:00 2001 From: Sebastien Chopin Date: Fri, 5 May 2017 16:47:50 +0200 Subject: [PATCH] Improve logs --- lib/build.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/build.js b/lib/build.js index c9fcc9d2e6..fe56ac0704 100644 --- a/lib/build.js +++ b/lib/build.js @@ -425,11 +425,7 @@ function webpackWatchAndUpdate () { if (err) throw err const bundleExists = serverFS.existsSync(bundlePath) const manifestExists = clientFS.existsSync(manifestPath) - if (!bundleExists) { - debug('Waiting for server bundle...') - } else if (!manifestExists) { - debug('Waiting for client manifest...') - } else { + if (bundleExists && manifestExists) { const bundle = serverFS.readFileSync(bundlePath, 'utf8') const manifest = clientFS.readFileSync(manifestPath, 'utf8') createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) @@ -463,11 +459,13 @@ function webpackRunServer () { const bundlePath = join(serverConfig.output.path, 'server-bundle.json') const manifestPath = join(serverConfig.output.path, 'client-manifest.json') readFile(bundlePath, 'utf8') - .then(bundle => readFile(manifestPath, 'utf8') + .then(bundle => { + readFile(manifestPath, 'utf8') .then(manifest => { createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) resolve() - })) + }) + }) }) }) } @@ -485,8 +483,10 @@ function createRenderer (bundle, manifest) { this.renderer = createBundleRenderer(bundle, Object.assign({ cache: cacheConfig, clientManifest: manifest, - runInNewContext: false - }, this.options.ssr)) + runInNewContext: false, + inject: false, + baseDir: this.options.dir + }, this.options.build.ssr)) this.renderToString = pify(this.renderer.renderToString) this.renderToStream = this.renderer.renderToStream }