From 2440007906b0690db56d13f0a347e3fb645180dc Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 24 May 2024 11:17:35 +0100 Subject: [PATCH] fix(nuxt): resolve modules from layers directories (#27338) --- packages/nuxt/src/core/nuxt.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/nuxt/src/core/nuxt.ts b/packages/nuxt/src/core/nuxt.ts index 9f557528b7..5d57d55f46 100644 --- a/packages/nuxt/src/core/nuxt.ts +++ b/packages/nuxt/src/core/nuxt.ts @@ -272,6 +272,9 @@ async function initNuxt (nuxt: Nuxt) { ...nuxt.options._layers.filter(i => i.cwd.includes('node_modules')).map(i => i.cwd as string), ) + // Ensure we can resolve dependencies within layers + nuxt.options.modulesDir.push(...nuxt.options._layers.map(l => resolve(l.cwd, 'node_modules'))) + // Init user modules await nuxt.callHook('modules:before') const modulesToInstall = []