Skip to content

Commit

Permalink
fix: allow Rsbuild plugin to be registered times (#3818)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Oct 24, 2024
1 parent 00ae832 commit 2f9d1a4
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/core/src/pluginManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,7 @@ export function createPluginManager(): PluginManager {

validatePlugin(newPlugin);

const existPlugin = plugins.find(
(item) =>
item.instance.name === newPlugin.name &&
item.environment === environment,
);

if (existPlugin) {
logger.warn(
`Rsbuild plugin "${newPlugin.name}" registered multiple times.`,
);
} else if (before) {
if (before) {
const index = plugins.findIndex(
(item) => item.instance.name === before,
);
Expand Down

0 comments on commit 2f9d1a4

Please sign in to comment.