A Tauri plugin and Module Federation Runtime plugin that caches remote modules for offline use.
The Federation Runtime plugin rewrites remote module requests to use the module-federation:// URI scheme, which is then handled by the Tauri plugin. Files loaded over this URI scheme are cached for serving when fetching from the network fails.
- The host app registers the runtime plugin via
runtimePluginsin its Module Federation config - The plugin intercepts remote module resolution (
afterResolve) and rewrites entry URLs tomodule-federation://<host>/?fullUrl=<original_url> - The Tauri plugin handles the custom URI scheme, fetching from the network and caching the response
- On subsequent loads, if the network is unavailable, the cached version is served instead
| Directory | Description |
|---|---|
tauri-plugin/ |
Rust Tauri plugin — handles the module-federation:// custom protocol and caching |
module-federation-plugin/ |
JavaScript runtime plugin (@crabnebula-dev/tauri-module-federation) — rewrites remote URLs |
example/ |
Example apps demonstrating the setup |
- Rust
- Node.js (v18+)
- pnpm
- Tauri prerequisites
pnpm install
cd example && pnpm devSee example/README.md for more details.