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

    1. export default {
    2. extendPlugins(plugins) {
    3. const pluginIndex = plugins.findIndex(
    4. ({ src }) => src === '~/plugins/shouldBeFirst.js'
    5. )
    6. const shouldBeFirstPlugin = plugins[pluginIndex]
    7. plugins.splice(pluginIndex, 1)
    8. plugins.unshift(shouldBeFirstPlugin)
    9. return plugins
    10. }
    11. }