@angular-architects/native-federation 18.2.6 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -330,7 +330,6 @@ Now, by clicking at the 2nd menu item, you can load the remote directly into the
|
|
|
330
330
|
|
|
331
331
|
If you like the idea of webpack Module Federation but want to switch over to Angular's new esbuild builder, you can use this package.
|
|
332
332
|
|
|
333
|
-
|
|
334
333
|
### I get an error when preparing shared packages. What to do?
|
|
335
334
|
|
|
336
335
|
Native Federation needs to prepare all your shared packages so that it can load them on demand as EcmaScript modules. This only happens once for development and once for production builds. The result of this is cached.
|
|
@@ -349,7 +348,6 @@ For this, there are several reasons:
|
|
|
349
348
|
|
|
350
349
|
The good message is, that the official Angular Package Format defines the usage of ECMA Script Modules (ESM) for years. This is the future-proof standard, Native Federation is built upon and all npm packages created with the Angular CLI follow. If you use older CommonJS-based packages, Native Federation automatically converts them to ESM. Depending on the package, this might change some details. Here, you find some [information for dealing with CommonJS packages](https://shorturl.at/jmzH0).
|
|
351
350
|
|
|
352
|
-
|
|
353
351
|
## How to Deal with Transitive Dependencies?
|
|
354
352
|
|
|
355
353
|
Since version 18@latest, also transitive dependencies are shared. For instance, `primeng` uses a lib `@primeuix/styled` for theming. The latter one is now shared too if `primeng` is. This prevents possible challanges but also results in more bundles. If you don't want to share such a transitive dependency, just put it into the `skip` list.
|
|
@@ -361,14 +359,18 @@ Usually, Native Federation automatically detects entry points into shared packag
|
|
|
361
359
|
```js
|
|
362
360
|
module.exports = withNativeFederation({
|
|
363
361
|
shared: {
|
|
364
|
-
...shareAll({
|
|
362
|
+
...shareAll({
|
|
363
|
+
singleton: true,
|
|
364
|
+
strictVersion: true,
|
|
365
|
+
requiredVersion: 'auto',
|
|
366
|
+
}),
|
|
365
367
|
'test-pkg': {
|
|
366
368
|
packageInfo: {
|
|
367
369
|
entryPoint: '/path/to/test-pkg/entry.mjs',
|
|
368
370
|
version: '1.0.0',
|
|
369
|
-
esm: true
|
|
370
|
-
}
|
|
371
|
-
}
|
|
371
|
+
esm: true,
|
|
372
|
+
},
|
|
373
|
+
},
|
|
372
374
|
},
|
|
373
375
|
});
|
|
374
376
|
```
|