diff --git a/packages/builder/src/builder.js b/packages/builder/src/builder.js index 140790d5a5..b4e0d9442e 100644 --- a/packages/builder/src/builder.js +++ b/packages/builder/src/builder.js @@ -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) diff --git a/packages/builder/src/context.js b/packages/builder/src/context.js index 25178c150b..3b60d116e4 100644 --- a/packages/builder/src/context.js +++ b/packages/builder/src/context.js @@ -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 } }