Skip to content

fix: correct plugin modification warning logic#5302

Merged
chenjiahan merged 1 commit intomainfrom
plugin_warning_0523
May 23, 2025
Merged

fix: correct plugin modification warning logic#5302
chenjiahan merged 1 commit intomainfrom
plugin_warning_0523

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

Correct the plugin modification warning logic, if the modifiedConfig.plugins is undefined, we should not print a warning.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings May 23, 2025 14:46
@netlify
Copy link
Copy Markdown

netlify bot commented May 23, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 3bc4fd1
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68308a4fc990940008fb5020
😎 Deploy Preview https://deploy-preview-5302--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 57 (🔴 down 29 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the warning logic in modifyRsbuildConfig so that no warning is printed when modified.plugins is undefined by treating it as an empty array.

  • Changed the conditional to use a default count of 0 when modified.plugins is undefined.
  • Introduced a newPluginsCount variable for clarity.
Comments suppressed due to low confidence (1)

packages/core/src/provider/initConfigs.ts:36

  • Add a unit test for the case when modified.plugins is undefined to verify that no warning is emitted.
const newPluginsCount = modified.plugins?.length ?? 0;

@chenjiahan chenjiahan merged commit 31c37fd into main May 23, 2025
12 checks passed
@chenjiahan chenjiahan deleted the plugin_warning_0523 branch May 23, 2025 23:03
@chenjiahan chenjiahan mentioned this pull request May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants