From 994d01e24f2a613716145c05fab2fb8b938c9795 Mon Sep 17 00:00:00 2001 From: 2heal1 Date: Wed, 13 Nov 2024 15:48:30 +0800 Subject: [PATCH] chore: export rsbuild plugin name & rspack plugin name --- packages/rsbuild-plugin/src/cli/index.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/rsbuild-plugin/src/cli/index.ts b/packages/rsbuild-plugin/src/cli/index.ts index f59cac8558d..82b96858d3f 100644 --- a/packages/rsbuild-plugin/src/cli/index.ts +++ b/packages/rsbuild-plugin/src/cli/index.ts @@ -15,14 +15,19 @@ import logger from '../logger'; type ModuleFederationOptions = moduleFederationPlugin.ModuleFederationPluginOptions; -const PLUGIN_MODULE_FEDERATION_NAME = 'rsbuild:module-federation-enhanced'; +const RSBUILD_PLUGIN_MODULE_FEDERATION_NAME = + 'rsbuild:module-federation-enhanced'; +const RSPACK_PLUGIN_MODULE_FEDERATION_NAME = 'module-federation'; -export { PLUGIN_MODULE_FEDERATION_NAME }; +export { + RSBUILD_PLUGIN_MODULE_FEDERATION_NAME, + RSPACK_PLUGIN_MODULE_FEDERATION_NAME, +}; export const pluginModuleFederation = ( moduleFederationOptions: ModuleFederationOptions, ): RsbuildPlugin => ({ - name: PLUGIN_MODULE_FEDERATION_NAME, + name: RSBUILD_PLUGIN_MODULE_FEDERATION_NAME, setup: (api) => { const sharedOptions: [string, sharePlugin.SharedConfig][] = parseOptions( moduleFederationOptions.shared || [], @@ -156,7 +161,7 @@ export const pluginModuleFederation = ( api.modifyBundlerChain(async (chain) => { chain - .plugin('module-federation') + .plugin(RSPACK_PLUGIN_MODULE_FEDERATION_NAME) .use(ModuleFederationPlugin, [moduleFederationOptions]); // `uniqueName` is required for react refresh to work