0.6.15 • Published 8 months ago

@module-federation/retry-plugin v0.6.15

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

@module-federation/retry-plugin

A plugin for retrying failed module requests.

Usage

// ./src/runtime-plugin/retry.ts
import { RetryPlugin } from '@module-federation/retry-plugin';
const retryPlugin = () => RetryPlugin({
    fetch: {
        url: 'http://localhost:2008/not-exist-mf-manifest.json',
        fallback: () => 'http://localhost:2001/mf-manifest.json',
    },
    script: {
        // url: 'http://localhost:2008/not-exist-mf-manifest.json',
        url: 'http://localhost:2001/static/js/async/src_App_tsx.js',
        customCreateScript: (url: string, attrs: Record<string, string>) => {
            let script = document.createElement('script');
            script.src = `http://localhost:2011/static/js/async/src_App_tsx.js`;
            script.setAttribute('loader-hoos', 'isTrue');
            script.setAttribute('crossorigin', 'anonymous');
            return script;
        },
    }
})

export default defineConfig({
  tools: {
    rspack: (config, { appendPlugins }) => {
      appendPlugins([
        new ModuleFederationPlugin({
          ...,
+         runtimePlugins: [
+            path.join(__dirname, './src/runtime-plugin/retry.ts'),
+         ],
        }),
      ]);
    },
  },
  plugins: [pluginReact()],
});

Documentation

See https://module-federation.io/plugin/plugins/retry-plugin.html for details.

License

@module-federation/retry-plugin is MIT licensed.

0.6.15

8 months ago

0.6.14

8 months ago

0.6.13

8 months ago

0.6.12

8 months ago

0.6.11

8 months ago

0.6.7

9 months ago

0.6.9

9 months ago

0.6.8

9 months ago

0.6.10

8 months ago

0.6.6

9 months ago

0.6.5

9 months ago

0.6.4

9 months ago

0.6.3

9 months ago

0.6.2

9 months ago

0.6.1

9 months ago

0.6.0

9 months ago