modules (config)
Registers Nuxt modules that extend the framework at build time.
Syntax
modules: [string | [string, options] | NuxtModule] Parameters
| Name | Type | Required | Description |
|---|---|---|---|
modules | Array<string | [string, object] | NuxtModule> | No | List of module names/paths, optionally as a tuple with inline options, or an inline module function. |
Returns
NuxtConfig — Configuration field consumed at build time.
Examples
export default defineNuxtConfig({
modules: [
'@nuxt/image',
'@pinia/nuxt',
['@nuxtjs/google-fonts', { families: { Inter: true } }],
],
})
export default defineNuxtConfig({
modules: ['@nuxtjs/tailwindcss'],
// Some modules also read a top-level options key
googleFonts: { families: { Roboto: [400, 700] } },
})
Notes
Modules run at build time and can add components, composables, server
routes, and config. Order can matter for modules that depend on each
other. Inline options can be passed via the tuple form or via a
dedicated top-level key documented by the module.