mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Improve logs
This commit is contained in:
parent
39db08c95b
commit
6178527177
18
lib/build.js
18
lib/build.js
@ -425,11 +425,7 @@ function webpackWatchAndUpdate () {
|
|||||||
if (err) throw err
|
if (err) throw err
|
||||||
const bundleExists = serverFS.existsSync(bundlePath)
|
const bundleExists = serverFS.existsSync(bundlePath)
|
||||||
const manifestExists = clientFS.existsSync(manifestPath)
|
const manifestExists = clientFS.existsSync(manifestPath)
|
||||||
if (!bundleExists) {
|
if (bundleExists && manifestExists) {
|
||||||
debug('Waiting for server bundle...')
|
|
||||||
} else if (!manifestExists) {
|
|
||||||
debug('Waiting for client manifest...')
|
|
||||||
} else {
|
|
||||||
const bundle = serverFS.readFileSync(bundlePath, 'utf8')
|
const bundle = serverFS.readFileSync(bundlePath, 'utf8')
|
||||||
const manifest = clientFS.readFileSync(manifestPath, 'utf8')
|
const manifest = clientFS.readFileSync(manifestPath, 'utf8')
|
||||||
createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest))
|
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 bundlePath = join(serverConfig.output.path, 'server-bundle.json')
|
||||||
const manifestPath = join(serverConfig.output.path, 'client-manifest.json')
|
const manifestPath = join(serverConfig.output.path, 'client-manifest.json')
|
||||||
readFile(bundlePath, 'utf8')
|
readFile(bundlePath, 'utf8')
|
||||||
.then(bundle => readFile(manifestPath, 'utf8')
|
.then(bundle => {
|
||||||
|
readFile(manifestPath, 'utf8')
|
||||||
.then(manifest => {
|
.then(manifest => {
|
||||||
createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest))
|
createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest))
|
||||||
resolve()
|
resolve()
|
||||||
}))
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -485,8 +483,10 @@ function createRenderer (bundle, manifest) {
|
|||||||
this.renderer = createBundleRenderer(bundle, Object.assign({
|
this.renderer = createBundleRenderer(bundle, Object.assign({
|
||||||
cache: cacheConfig,
|
cache: cacheConfig,
|
||||||
clientManifest: manifest,
|
clientManifest: manifest,
|
||||||
runInNewContext: false
|
runInNewContext: false,
|
||||||
}, this.options.ssr))
|
inject: false,
|
||||||
|
baseDir: this.options.dir
|
||||||
|
}, this.options.build.ssr))
|
||||||
this.renderToString = pify(this.renderer.renderToString)
|
this.renderToString = pify(this.renderer.renderToString)
|
||||||
this.renderToStream = this.renderer.renderToStream
|
this.renderToStream = this.renderer.renderToStream
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user