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:

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

    plugins.splice(pluginIndex, 1)

    return plugins

如何提交问题或文档贡献? 在 GitHub 编辑此页面!

Platinum Sponsors

StoryblokMoovwebShip Shape Support Us