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

Commit

Permalink
feat(nuxt): allow configuring plugins directory
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 4, 2022
1 parent 92ff066 commit f3cee1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit f3cee1c

Please sign in to comment.