From 264bf98339db8530989dd1ce54339410c18e691d Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 9 Mar 2024 06:56:21 +0000 Subject: [PATCH] fix(nuxt): clone paths to prevent shared object --- packages/nuxt/src/core/nuxt.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/core/nuxt.ts b/packages/nuxt/src/core/nuxt.ts index 0ea6c659fd00..1706349cb4a7 100644 --- a/packages/nuxt/src/core/nuxt.ts +++ b/packages/nuxt/src/core/nuxt.ts @@ -72,7 +72,7 @@ async function initNuxt (nuxt: Nuxt) { // Set nitro resolutions for types that might be obscured with shamefully-hoist=false nuxt.options.nitro.typescript = defu(nuxt.options.nitro.typescript, { - tsConfig: { compilerOptions: { paths } } + tsConfig: { compilerOptions: { paths: { ...paths } } } }) // Add nuxt types @@ -88,7 +88,7 @@ async function initNuxt (nuxt: Nuxt) { opts.references.push({ path: resolve(nuxt.options.buildDir, 'types/app.config.d.ts') }) // Set Nuxt resolutions for types that might be obscured with shamefully-hoist=false - opts.tsConfig.compilerOptions = defu(opts.tsConfig.compilerOptions, { paths }) + opts.tsConfig.compilerOptions = defu(opts.tsConfig.compilerOptions, { paths: { ...paths } }) for (const layer of nuxt.options._layers) { const declaration = join(layer.cwd, 'index.d.ts')