From e52cb024c60dba7091f82dca7c1ae84e16637fec Mon Sep 17 00:00:00 2001 From: lozunoff Date: Wed, 8 Jan 2025 22:29:08 +0300 Subject: [PATCH] fix(dts-plugin): overwriting a directory with types on hot updates --- .changeset/real-ligers-design.md | 5 +++++ packages/dts-plugin/src/plugins/GenerateTypesPlugin.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/real-ligers-design.md diff --git a/.changeset/real-ligers-design.md b/.changeset/real-ligers-design.md new file mode 100644 index 0000000000..42f56ac07c --- /dev/null +++ b/.changeset/real-ligers-design.md @@ -0,0 +1,5 @@ +--- +'@module-federation/dts-plugin': minor +--- + +fixed overwriting a directory with types on hot updates diff --git a/packages/dts-plugin/src/plugins/GenerateTypesPlugin.ts b/packages/dts-plugin/src/plugins/GenerateTypesPlugin.ts index 9059d36c96..93a5fcf900 100644 --- a/packages/dts-plugin/src/plugins/GenerateTypesPlugin.ts +++ b/packages/dts-plugin/src/plugins/GenerateTypesPlugin.ts @@ -111,6 +111,7 @@ export class GenerateTypesPlugin implements WebpackPluginInstance { await new Promise((resolve, reject) => { compiler.outputFileSystem.mkdir( path.dirname(zipOutputPath), + { recursive: true }, (err) => { if (err) reject(err); else { @@ -138,6 +139,7 @@ export class GenerateTypesPlugin implements WebpackPluginInstance { await new Promise((resolve, reject) => { compiler.outputFileSystem.mkdir( path.dirname(apiOutputPath), + { recursive: true }, (err) => { if (err) reject(err); else {