From a71e88ddba511485dfc2f4c123c39d442d27135f Mon Sep 17 00:00:00 2001 From: "zhanghang.heal" Date: Thu, 20 Nov 2025 15:21:29 +0800 Subject: [PATCH] fix(dts-plugin): delete compilerOptions.declarationDir --- .changeset/nice-news-carry.md | 5 +++++ packages/dts-plugin/src/core/configurations/remotePlugin.ts | 3 +++ .../dts-plugin/src/core/configurations/tsconfig.test.json | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/nice-news-carry.md diff --git a/.changeset/nice-news-carry.md b/.changeset/nice-news-carry.md new file mode 100644 index 00000000000..85891afd662 --- /dev/null +++ b/.changeset/nice-news-carry.md @@ -0,0 +1,5 @@ +--- +'@module-federation/dts-plugin': patch +--- + +fix(dts-plugin): delete compilerOptions.declarationDir diff --git a/packages/dts-plugin/src/core/configurations/remotePlugin.ts b/packages/dts-plugin/src/core/configurations/remotePlugin.ts index 77d2ad7513e..143faa663ba 100644 --- a/packages/dts-plugin/src/core/configurations/remotePlugin.ts +++ b/packages/dts-plugin/src/core/configurations/remotePlugin.ts @@ -156,6 +156,9 @@ const readTsConfig = ( 'references' in rawTsConfigJson && delete rawTsConfigJson.references; rawTsConfigJson.extends = resolvedTsConfigPath; + if (rawTsConfigJson.compilerOptions.declarationDir) { + delete rawTsConfigJson.compilerOptions.declarationDir; + } return rawTsConfigJson; }; diff --git a/packages/dts-plugin/src/core/configurations/tsconfig.test.json b/packages/dts-plugin/src/core/configurations/tsconfig.test.json index 0e105b88cc2..00cb31f56d6 100644 --- a/packages/dts-plugin/src/core/configurations/tsconfig.test.json +++ b/packages/dts-plugin/src/core/configurations/tsconfig.test.json @@ -7,6 +7,7 @@ "esModuleInterop": true, "strict": true, "strictNullChecks": true, - "resolveJsonModule": true + "resolveJsonModule": true, + "declarationDir": "dts-dist" } }