Conversation
✅ 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 modifies the build process to disable minification by default for Node.js targets in production environments. The change aims to improve the debuggability and stability of server-side bundles, where clear stack traces and predictable runtime behavior are often more critical than minimal bundle size. While minification is no longer the default, it remains an available option for users who wish to explicitly enable it. Additionally, the update ensures consistent CSS output between server and client builds for better SSR compatibility. 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 implements the disabling of minification by default for Node.js bundles. The core logic change in packages/core/src/plugins/minimize.ts is clear and effectively sets the new default behavior based on the output target. The related changes, such as updating the CSS plugin to ensure consistency between server and client builds, and adjusting type definitions and tests, are all consistent with the main goal. The code quality is high, and the breaking change is appropriately marked. Overall, this is a solid improvement that enhances debuggability for server-side code.
There was a problem hiding this comment.
Pull request overview
This PR changes the default minification behavior for Node.js targets to prioritize debuggability and clear stack traces over bundle size. Minification is now disabled by default for target: 'node' in production builds, while remaining enabled by default for web and web-worker targets. Users can still explicitly enable minification for Node bundles via output.minify: true.
Key Changes
- Minification default is now target-dependent: disabled for
node, enabled forwebandweb-workerin production - CSS minification for SSR builds now follows the web environment's settings to ensure consistency
- The
minifyproperty was removed fromNormalizedOutputConfigas it's now computed dynamically
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/plugins/minimize.ts | Implements target-dependent default minification logic (false for node, true for web/web-worker) |
| packages/core/src/plugins/css.ts | Updates CSS minification for SSR to use web environment's settings for consistency |
| packages/core/src/defaultConfig.ts | Removes hardcoded minify: true default from output config |
| packages/core/src/types/config.ts | Removes minify from NormalizedOutputConfig interface (now computed dynamically) |
| packages/core/tests/snapshots/environments.test.ts.snap | Updates snapshots to remove minify: true from normalized config output |
| e2e/cases/polyfill/dirname-filename-node/index.test.ts | Updates test expectations to match unminified node bundle output (single quotes, spacing) |
| e2e/cases/plugin-vue/sfc-css-modules-ssr/index.test.ts | Updates test expectations to match unminified node bundle output (backticks instead of quotes) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
For Node targets, production builds no longer enable minification by default.
Server bundles prioritize debuggability, clear stack traces, and stable runtime behavior over bundle size. Minification remains available as an explicit opt-in via
output.minify: trueChecklist