Skip to content

fix(core): failed to register environment plugin#4437

Merged
chenjiahan merged 2 commits intomainfrom
env_plugin_0126
Jan 26, 2025
Merged

fix(core): failed to register environment plugin#4437
chenjiahan merged 2 commits intomainfrom
env_plugin_0126

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

Fix failed to register environment plugin.

Since #4283, rsbuildOptions.environment will be empty array by default, and we should use context.specifiedEnvironments to filter environments.

Related Links

#4435

Checklist

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

@netlify
Copy link
Copy Markdown

netlify bot commented Jan 26, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit e08a079
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/6795df7531fa58000800fdb5
😎 Deploy Preview https://deploy-preview-4437--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: 69 (🔴 down 4 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (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 site configuration.

@chenjiahan
Copy link
Copy Markdown
Member Author

@binarykitchen cc

@chenjiahan chenjiahan merged commit 5a18094 into main Jan 26, 2025
@chenjiahan chenjiahan deleted the env_plugin_0126 branch January 26, 2025 07:26
@@ -0,0 +1,2 @@
.title-class
font-size: 14px;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Small nitpick, in Stylus no need for : between property name and value

font-size 14px;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nice catch, do you want to submit a PR to polish our stylus code?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not critical, we developers are very busy :) Next time ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Haha, never mind, I can do it with cursor

import './a.styl';
import style from './b.module.styl';

console.log(style);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It is a good idea to console print during E2E tests?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

To prevent the bundler from removing unused `style' object.

This is client code, so the console.log won't affect the E2E logs.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ah, that's the most important change. Curious why this has been left out before?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I missed this place, my bad.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Appreciate your honesty 🙇

return;
}

// The current environment is not specified, skip it
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Grammar, add "If" the current environment is not specified ...

This was referenced Jan 26, 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