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












잘못된 부분이 있거나 이 문서에 기여하고 싶으신가요? GitHub에서 이 페이지를 수정해주세요!