builder no longer needs init

This commit is contained in:
Pooya Parsa 2017-06-14 22:09:32 +04:30
parent 7343af0d5f
commit 59f8e48549

View File

@ -42,23 +42,6 @@ export default class Builder extends Tapable {
this.webpackDevMiddleware = null
this.webpackHotMiddleware = null
if (nuxt.initialized) {
// If nuxt already initialized
this._init = this.init().catch(this.nuxt.errorHandler)
} else {
// Wait for hook
this.nuxt.plugin('init', () => {
this._init = this.init()
return this._init
})
}
}
async init () {
if (this._init) {
return this._init
}
// Add extra loaders only if they are not already provided
let extraDefaults = {}
if (this.options.build && !Array.isArray(this.options.build.loaders)) {