diff --git a/package.json b/package.json index 1ebfdc9..482b0e3 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@angular-devkit/core": "~22.0.0", "@angular-devkit/schematics": "~22.0.0", "@chialab/esbuild-plugin-commonjs": "^0.19.0", - "@softarc/native-federation": "^4.3.0", + "@softarc/native-federation": "^4.4.0", "@softarc/native-federation-orchestrator": "^4.5.0", "es-module-shims": "^2.8.0", "esbuild": "^0.28.0", diff --git a/src/tools/esbuild/node-modules-bundler.ts b/src/tools/esbuild/node-modules-bundler.ts index e680df9..912e681 100644 --- a/src/tools/esbuild/node-modules-bundler.ts +++ b/src/tools/esbuild/node-modules-bundler.ts @@ -129,6 +129,11 @@ export async function createNodeModulesEsbuildContext(options: NormalizedContext ); const config: esbuild.BuildOptions = { + // Named exports of CommonJS/UMD shared externals (issue #83, e.g. `import { isDayjs } + // from 'dayjs'`) are handled in core: `bundleSharedCore` runtime-enumerates each CJS + // external and hands us a synthetic entry (`ep.fileName` under `/.nf-cjs-entries/`) + // that re-exports `default` plus every named binding. We just bundle whatever entry core + // gives us — no adapter-side plugin needed (core >= 4.4.0, `synthesizeCjsExports`). entryPoints: entryPoints.map(ep => ({ in: ep.fileName, out: path.parse(ep.outName).name,