0.6.15 • Published 9 months ago

@module-federation/retry-plugin v0.6.15

Weekly downloads
-
License
MIT
Repository
-
Last release
9 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

9 months ago

0.6.14

9 months ago

0.6.13

9 months ago

0.6.12

9 months ago

0.6.11

9 months ago

0.6.7

10 months ago

0.6.9

10 months ago

0.6.8

10 months ago

0.6.10

10 months ago

0.6.6

10 months ago

0.6.5

10 months ago

0.6.4

11 months ago

0.6.3

11 months ago

0.6.2

11 months ago

0.6.1

11 months ago

0.6.0

11 months ago