Skip to content

Commit bccd803

Browse files
committed
maint(docs): Document that you only have to iport module_federation if you are creating a host bundle.
1 parent 3f7b49e commit bccd803

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/developer/module-federation.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
For a general introduction see: https://webpack.js.org/concepts/module-federation/
66

7-
Module Federation allows to share dependencies between bundles.
7+
Module Federation allows to share dependencies between bundles.
88
Each bundle includes the whole set of dependencies.
99
However, if multiple bundles have the same dependencies they are only loaded once.
1010

@@ -18,7 +18,15 @@ Other bundles are "remotes" which are initialized for module federation by the h
1818
## How to use it
1919

2020
- Create a new entry point ``index.js`` which only imports the normal entry point.
21-
If your bundle is the host bundle, also import the ``module_federation`` module - importing is enough.
21+
22+
```
23+
import("./patterns");
24+
```
25+
26+
If you are creating a host bundle - one which is always present and initializes add-on bundles - then also import the ``module_federation`` module.
27+
Importing is enough.
28+
Mockup is such a host bundle.
29+
Your ``index.js`` will then look like:
2230

2331
```
2432
import "@patternslib/patternslib/webpack/module_federation";

0 commit comments

Comments
 (0)