mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 16:43:55 +00:00
builder: decouple build from production logic
This commit is contained in:
parent
5768ef5092
commit
4c07a397e2
@ -119,10 +119,6 @@ export default class Builder extends Tapable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async production () {
|
async production () {
|
||||||
// Avoid calling this method multiple times
|
|
||||||
if (this._buildStatus === STATUS.BUILD_DONE) {
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
// Production, create server-renderer
|
// Production, create server-renderer
|
||||||
const serverConfig = this.getWebpackServerConfig()
|
const serverConfig = this.getWebpackServerConfig()
|
||||||
const bundlePath = join(serverConfig.output.path, 'server-bundle.json')
|
const bundlePath = join(serverConfig.output.path, 'server-bundle.json')
|
||||||
@ -135,7 +131,6 @@ export default class Builder extends Tapable {
|
|||||||
const manifest = fs.readFileSync(manifestPath, 'utf8')
|
const manifest = fs.readFileSync(manifestPath, 'utf8')
|
||||||
this.createRenderer(JSON.parse(bundle), JSON.parse(manifest))
|
this.createRenderer(JSON.parse(bundle), JSON.parse(manifest))
|
||||||
this.addAppTemplate()
|
this.addAppTemplate()
|
||||||
this._buildStatus = STATUS.BUILD_DONE
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user