fix(builder): await for renderer to load resources (#5341)

This commit is contained in:
Pooya Parsa 2019-03-23 11:32:55 +04:30 committed by GitHub
parent 95f2a125cf
commit caf5198430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -140,7 +140,7 @@ export default class VueRenderer {
// Try once to load SSR resources from fs // Try once to load SSR resources from fs
await this.loadResources(fs) await this.loadResources(fs)
// Without using `nuxt start` (Programmatic, Tests and Generate) // Without using `nuxt start` (programmatic, tests and generate)
if (!this.context.options._start) { if (!this.context.options._start) {
this.context.nuxt.hook('build:resources', () => this.loadResources(fs)) this.context.nuxt.hook('build:resources', () => this.loadResources(fs))
return return

View File

@ -173,6 +173,9 @@ export class WebpackBundler {
// Actual error will be printed by webpack // Actual error will be printed by webpack
throw new Error('Nuxt Build Error') throw new Error('Nuxt Build Error')
} }
// Await for renderer to load resources (programmatic, tests and generate)
await nuxt.callHook('build:resources')
} }
async webpackDev(compiler) { async webpackDev(compiler) {