Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat(nuxt): allow configuring plugins directory #7981

Merged
merged 1 commit into from Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/nuxt/src/core/app.ts
Expand Up @@ -104,8 +104,8 @@ export async function resolveApp (nuxt: Nuxt, app: NuxtApp) {
...(config.plugins || []),
...config.srcDir
? await resolveFiles(config.srcDir, [
'plugins/*.{ts,js,mjs,cjs,mts,cts}',
'plugins/*/index.*{ts,js,mjs,cjs,mts,cts}'
`${config.dir?.plugins || 'plugins'}/*.{ts,js,mjs,cjs,mts,cts}`,
`${config.dir?.plugins || 'plugins'}/*/index.*{ts,js,mjs,cjs,mts,cts}`
])
: []
].map(plugin => normalizePlugin(plugin as NuxtPlugin)))
Expand Down
5 changes: 5 additions & 0 deletions packages/schema/src/config/_common.ts
Expand Up @@ -503,6 +503,11 @@ export default defineUntypedSchema({
* @version 3
*/
pages: 'pages',
/**
* The plugins directory, each file of which will be auto-registered as a Nuxt plugin.
* @version 3
*/
plugins: 'plugins',
/**
* The directory containing your static files, which will be directly accessible via the Nuxt server
* and copied across into your `dist` folder when your app is generated.
Expand Down