@module-federation/dts-plugin
Advanced tools
Comparing version 0.0.0-next-20241216024258 to 0.0.0-next-20241216122636
# @module-federation/dts-plugin | ||
## 0.8.4 | ||
### Patch Changes | ||
- 5ea7aea: Lazy emit DTS files on hmr rebuilds, do not block compiler pipeline | ||
- @module-federation/sdk@0.8.4 | ||
- @module-federation/managers@0.8.4 | ||
- @module-federation/third-party-dts-extractor@0.8.4 | ||
- @module-federation/error-codes@0.8.4 | ||
## 0.8.3 | ||
@@ -14,0 +4,0 @@ |
@@ -332,55 +332,2 @@ import { | ||
let compiledOnce = false; | ||
const emitTypesFiles = /* @__PURE__ */ __name(() => __async(this, null, function* () { | ||
try { | ||
const { zipTypesPath, apiTypesPath, zipName, apiFileName } = retrieveTypesAssetsInfo(finalOptions.remote); | ||
yield generateTypesFn(finalOptions); | ||
const config = finalOptions.remote.moduleFederationConfig; | ||
let zipPrefix = ""; | ||
if (typeof config.manifest === "object" && config.manifest.filePath) { | ||
zipPrefix = config.manifest.filePath; | ||
} else if (typeof config.manifest === "object" && config.manifest.fileName) { | ||
zipPrefix = path4.dirname(config.manifest.fileName); | ||
} else if (config.filename) { | ||
zipPrefix = path4.dirname(config.filename); | ||
} | ||
if (zipTypesPath) { | ||
const zipContent = fs2.readFileSync(zipTypesPath); | ||
const zipOutputPath = path4.join(compiler.outputPath, zipPrefix, zipName); | ||
yield new Promise((resolve2, reject) => { | ||
compiler.outputFileSystem.mkdir(path4.dirname(zipOutputPath), (err) => { | ||
if (err) | ||
reject(err); | ||
else { | ||
compiler.outputFileSystem.writeFile(zipOutputPath, zipContent, (writeErr) => { | ||
if (writeErr) | ||
reject(writeErr); | ||
else | ||
resolve2(); | ||
}); | ||
} | ||
}); | ||
}); | ||
} | ||
if (apiTypesPath) { | ||
const apiContent = fs2.readFileSync(apiTypesPath); | ||
const apiOutputPath = path4.join(compiler.outputPath, zipPrefix, apiFileName); | ||
yield new Promise((resolve2, reject) => { | ||
compiler.outputFileSystem.mkdir(path4.dirname(apiOutputPath), (err) => { | ||
if (err) | ||
reject(err); | ||
else { | ||
compiler.outputFileSystem.writeFile(apiOutputPath, apiContent, (writeErr) => { | ||
if (writeErr) | ||
reject(writeErr); | ||
else | ||
resolve2(); | ||
}); | ||
} | ||
}); | ||
}); | ||
} | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
}), "emitTypesFiles"); | ||
compiler.hooks.thisCompilation.tap("mf:generateTypes", (compilation) => { | ||
@@ -394,10 +341,6 @@ compilation.hooks.processAssets.tapPromise({ | ||
}, () => __async(this, null, function* () { | ||
if (pluginOptions.dev === false && compiledOnce) { | ||
return; | ||
} | ||
try { | ||
if (pluginOptions.dev === false && compiledOnce) { | ||
return; | ||
} | ||
if (compiledOnce) { | ||
emitTypesFiles(); | ||
return; | ||
} | ||
const { zipTypesPath, apiTypesPath, zipName, apiFileName } = retrieveTypesAssetsInfo(finalOptions.remote); | ||
@@ -425,3 +368,3 @@ if (zipName && compilation.getAsset(zipName)) { | ||
} catch (err) { | ||
console.error("Error in mf:generateTypes processAssets hook:", err); | ||
console.error(err); | ||
} | ||
@@ -428,0 +371,0 @@ })); |
{ | ||
"name": "@module-federation/dts-plugin", | ||
"version": "0.8.4", | ||
"version": "0.8.3", | ||
"author": "hanric <hanric.zhang@gmail.com>", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
{ | ||
"name": "@module-federation/dts-plugin", | ||
"version": "0.0.0-next-20241216024258", | ||
"version": "0.0.0-next-20241216122636", | ||
"author": "hanric <hanric.zhang@gmail.com>", | ||
@@ -63,6 +63,6 @@ "main": "./dist/index.js", | ||
"ws": "8.18.0", | ||
"@module-federation/sdk": "0.0.0-next-20241216024258", | ||
"@module-federation/managers": "0.0.0-next-20241216024258", | ||
"@module-federation/third-party-dts-extractor": "0.0.0-next-20241216024258", | ||
"@module-federation/error-codes": "0.0.0-next-20241216024258" | ||
"@module-federation/sdk": "0.0.0-next-20241216122636", | ||
"@module-federation/managers": "0.0.0-next-20241216122636", | ||
"@module-federation/third-party-dts-extractor": "0.0.0-next-20241216122636", | ||
"@module-federation/error-codes": "0.0.0-next-20241216122636" | ||
}, | ||
@@ -76,3 +76,3 @@ "devDependencies": { | ||
"vue-tsc": "^2.0.26", | ||
"@module-federation/runtime": "0.0.0-next-20241216024258" | ||
"@module-federation/runtime": "0.0.0-next-20241216122636" | ||
}, | ||
@@ -79,0 +79,0 @@ "peerDependencies": { |
Sorry, the diff of this file is too big to display
568068
14238
+ Added@module-federation/error-codes@0.0.0-next-20241216122636(transitive)
+ Added@module-federation/managers@0.0.0-next-20241216122636(transitive)
+ Added@module-federation/sdk@0.0.0-next-20241216122636(transitive)
+ Added@module-federation/third-party-dts-extractor@0.0.0-next-20241216122636(transitive)
- Removed@module-federation/error-codes@0.0.0-next-20241216024258(transitive)
- Removed@module-federation/managers@0.0.0-next-20241216024258(transitive)
- Removed@module-federation/sdk@0.0.0-next-20241216024258(transitive)
- Removed@module-federation/third-party-dts-extractor@0.0.0-next-20241216024258(transitive)
Updated@module-federation/error-codes@0.0.0-next-20241216122636
Updated@module-federation/managers@0.0.0-next-20241216122636
Updated@module-federation/third-party-dts-extractor@0.0.0-next-20241216122636