Skip to content

Commit b4e7dec

Browse files
committed
fix(module): clone layers to prevent side-effect
1 parent ce20ef2 commit b4e7dec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ export async function loadContentConfig(nuxt: Nuxt, options: { defaultFallback?:
3434
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3535
(globalThis as any).defineContentConfig = (c: any) => c
3636

37+
const layers = [...nuxt.options._layers].reverse()
3738
const contentConfigs = await Promise.all(
38-
nuxt.options._layers.reverse().map(
39+
layers.map(
3940
layer => loader<NuxtContentConfig>({ name: 'content', cwd: layer.config.rootDir, defaultConfig: options.defaultFallback ? defaultConfig : undefined }),
4041
),
4142
)

0 commit comments

Comments
 (0)