Skip to content

Commit ae71b0a

Browse files
authored
fix: remove eggPlugin missing warning from egg_loader (#5815)
The `eggPlugin` field in `package.json` is no longer required since plugins now use `definePluginFactory()` to declare their config. Remove the noisy warning that fires for every plugin loaded via the `package` pattern: ``` WARN [@eggjs/core/egg_loader] pkg.eggPlugin is missing in .../node_modules/@eggjs/redis/package.json ``` This warning was originally useful for egg v2/v3 plugins that relied on `eggPlugin` in `package.json` for dependency resolution. With v4's `definePluginFactory()`, plugin metadata is declared in code instead. [skip ci] <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Reduced unnecessary warning messages during plugin configuration loading. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 97a0339 commit ae71b0a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/core/src/loader/egg_loader.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,12 +630,13 @@ export class EggLoader {
630630
plugin.path = await this.#formatPluginPathFromPackageJSON(plugin.path as string, pkg);
631631
}
632632

633-
const logger = this.options.logger;
634633
if (!eggPluginConfig) {
635-
logger.warn('[@eggjs/core/egg_loader] pkg.eggPlugin is missing in %s, plugin: %j', pluginPackage, plugin);
634+
// eggPlugin in package.json is no longer required since plugins
635+
// now use definePluginFactory() to declare their config
636636
return;
637637
}
638638

639+
const logger = this.options.logger;
639640
if (eggPluginConfig.name && eggPluginConfig.strict !== false && eggPluginConfig.name !== plugin.name) {
640641
// pluginName is configured in config/plugin.js
641642
// pluginConfigName is pkg.eggPlugin.name

0 commit comments

Comments
 (0)