mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
refactor(builder): make plugins in BuildContext update dynamically (#4280)
This commit is contained in:
parent
3f2b10ea0c
commit
3953eef271
@ -207,8 +207,8 @@ export default class Builder {
|
||||
async generateRoutesAndFiles() {
|
||||
consola.debug(`Generating nuxt files`)
|
||||
|
||||
this.plugins.length = 0
|
||||
this.plugins.push.apply(this.plugins, this.normalizePlugins())
|
||||
// Plugins
|
||||
this.plugins = Array.from(this.normalizePlugins())
|
||||
|
||||
// -- Templates --
|
||||
let templatesFiles = Array.from(this.template.templatesFiles)
|
||||
|
@ -1,8 +1,12 @@
|
||||
export default class BuildContext {
|
||||
constructor(builder) {
|
||||
this._builder = builder
|
||||
this.nuxt = builder.nuxt
|
||||
this.options = builder.nuxt.options
|
||||
this.isStatic = false
|
||||
this.plugins = builder.plugins
|
||||
}
|
||||
|
||||
get plugins() {
|
||||
return this._builder.plugins
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user