mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 01:22:49 +00:00
22 lines
766 B
Markdown
22 lines
766 B
Markdown
# `@module-federation/webpack-bundler-runtime`
|
|
|
|
- Extract the build runtime and combine it with the internal runtime
|
|
- Used with webpack/rspack
|
|
|
|
## Usage
|
|
|
|
The package needs to be used with webpack/rspack bundler. It will export federation object which includes runtime, instance, bundlerRuntime, initOptions, attachShareScopeMap, bundlerRuntimeOptions.
|
|
|
|
After referencing, mount it to the corresponding bundler runtime, and then use the corresponding api/instance.
|
|
|
|
- example
|
|
|
|
```ts
|
|
import federation from '@module-federation/webpack-bundler-runtime';
|
|
|
|
__webpack_require__.federation = federation;
|
|
|
|
__webpack_require__.f.remotes = __webpack_require__.federation.remotes(options);
|
|
__webpack_require__.f.consumes = __webpack_require__.federation.remotes(options);
|
|
```
|