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 {