fix: ensure output.minify has a default value based on target#6979
fix: ensure output.minify has a default value based on target#6979chenjiahan merged 2 commits intomainfrom
output.minify has a default value based on target#6979Conversation
✅ Deploy Preview for rsbuild-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary of ChangesHello @chenjiahan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly centralizes the default value logic for output.minify based on the build target. The change ensures that output.minify has a predictable default value, which fixes an issue with the CSS minimizer plugin. The related code in the minimize plugin is also updated to remove the local default and improve robustness. The snapshot tests are updated accordingly, confirming the fix. The changes look good overall.
There was a problem hiding this comment.
Pull request overview
This PR ensures output.minify has a default value based on the target environment to fix compatibility with the rsbuild-plugin-css-minimizer plugin.
Changes:
- Moved default
output.minifyvalue initialization from the minimize plugin to the config initialization phase - Updated
parseMinifyOptionsto handle the case whereminifymight still be undefined - Updated test snapshots to reflect the new default values in normalized configurations
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/initConfigs.ts | Added logic to set default output.minify value based on target (true for web/web-worker, false for node) |
| packages/core/src/plugins/minimize.ts | Removed default value assignment from destructuring and updated condition to handle undefined case |
| packages/core/tests/snapshots/environments.test.ts.snap | Updated snapshots to include the new default minify values in normalized configurations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Ensure
output.minifyhas a default value based on target, otherwise the rsbuild-plugin-css-minimizer will not work as expected.Related
Checklist