⚠️ You are looking at the english version of the page. Help us translate it here.
Want to take a look at our new docs? Our new docs are now in beta. Have fun!

The extendPlugins Property

The extendPlugins property lets you customize Nuxt.js plugins (options.plugins).

  • Type: Function
  • Default: undefined

You may want to extend plugins or change plugins order created by Nuxt.js. This function accepts an array of plugin objects and should return array of plugin objects.

Example of changing plugins order (nuxt.config.js):

export default {
  extendPlugins(plugins) {
    const pluginIndex = plugins.findIndex(
      ({ src }) => src === '~/plugins/shouldBeFirst.js'
    )
    const shouldBeFirstPlugin = plugins[pluginIndex]

    plugins.splice(pluginIndex, 1)
    plugins.unshift(shouldBeFirstPlugin)

    return plugins
  }
}

Contributors

Contribution for this page is now closed. If you would like to contribute please check out our new docs are now in beta. Have fun!

Platinum Sponsors

StoryblokMoovweb Support Us