Nuxt 2 reached end of life on 30 June 2024
It no longer receives bug fixes or security patches. Upgrade to Nuxt 4 or get extended support from HeroDevs

The extendPlugins Property

The extendPlugins property lets you customize Nuxt plugins.
  • Type: Function
  • Default: undefined

You may want to extend plugins or change plugins order created by Nuxt. 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(
      plugin => (typeof plugin === 'string' ? plugin : plugin.src) === '~/plugins/shouldBeFirst.js'
    )
    const shouldBeFirstPlugin = plugins[pluginIndex]

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

    return plugins
  }
}