Federated.URLResolverConfig
Configuration options for createURLResolver for Module Federation. Allows to configure how created URLResolver will behave.
• Optional
chunks: Record
<string
, string
>
An optional Module Federation container names to URL templates mapping.
The key in the object is a container names and the value is a template that will be used to resolve a chunk URL for that container.
Specifying this property is useful if:
.container.bundle
).chunk.bundle
)When this property is left unspecified, the template URLs are inferred from
containers
property. The following:
is equivalent to:
Accepted template params:
[name]
- Container name[ext]
- Chunk extension, eg: .chunk.bundle
example
packages/repack/src/modules/ScriptManager/federated.ts:98
• containers: Record
<string
, string
>
A Module Federation container names to URL templates mapping.
The key in the object is a container name and the value is a template that will be used to resolve a URL.
Accepted template params:
[name]
- Container name[ext]
- Container extension, eg: .container.bundle
You can omit [ext]
, if you're using custom extension, in which case, you should
provide extension explicitly. When using custom extension, it's recommended to
provide a URL template for chunks as well using chunks
property.
example