Skip to content

Commit

Permalink
fix: avoid mutating _layers (#1455)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 16, 2022
1 parent e95d512 commit f592e7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ export default defineNuxtModule<ModuleOptions>({
})

// Register user global components
for (const layer of nuxt.options._layers.reverse()) {
const _layers = [...nuxt.options._layers].reverse()
for (const layer of _layers) {
const srcDir = layer.config.srcDir
const globalComponents = resolve(srcDir, 'components/content')
const dirStat = await fs.promises.stat(globalComponents).catch(() => null)
Expand Down

0 comments on commit f592e7b

Please sign in to comment.