Federated.createRemote
▸ createRemote(remote
): string
Creates JavaScript loading code for the given Module Federation remote
allowing to import that remote without creating an async boundary, but with
simple import statement, eg: import MyComponent from 'my-remote/MyComponent';
.
Federated.createRemote
adds a default resolver for container and it's chunks
with priority 0
, if you provide URL after the @
.
If dynamic
(eg module1@dynamic
) is provided, no default resolver will be added.
This function should be used only when using webpack.container.ModuleFederationPlugin
.
For Repack.plugins.ModuleFederationPlugin
, Federated.createRemote
is used under the hood.
Remote container will be evaluated only once. If you import module from the same container twice, the container will be loaded and evaluated only on the first import.
example
Name | Type | Description |
---|---|---|
remote |
string |
Remote name with URL or dynamic separated by @ . |
string
A JavaScript loading code the the given remote.