From 37c92e73984d7f90ae41a14f8b20841512e471c5 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 14 Jun 2017 01:13:00 +0430 Subject: [PATCH] better build chain --- lib/builder.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/builder.js b/lib/builder.js index 487a762531..8ff1e3e5c0 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -125,7 +125,9 @@ export default class Builder extends Tapable { const manifestPath = join(serverConfig.output.path, 'client-manifest.json') if (!fs.existsSync(bundlePath) || !fs.existsSync(manifestPath)) { console.error('[warning] No build files found, trying to build for production') // eslint-disable-line no-console - await this.build() + return this.build().then(() => { + return this.production() + }) } const bundle = fs.readFileSync(bundlePath, 'utf8') const manifest = fs.readFileSync(manifestPath, 'utf8')