better build chain

This commit is contained in:
Pooya Parsa 2017-06-14 01:13:00 +04:30
parent fa97b2af67
commit 37c92e7398
1 changed files with 3 additions and 1 deletions

View File

@ -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')