Skip to content

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Jun 24, 2025

Summary

Correct environment check for devtoolModuleFilenameTemplate. Using isDev (mode) to judge will be more accurate than using NODE_ENV.

Checklist

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

Copilot AI review requested due to automatic review settings June 24, 2025 14:31
@netlify
Copy link

netlify bot commented Jun 24, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit f82ef7d
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/685ab6de9d000a0008def2b1
😎 Deploy Preview https://deploy-preview-5477--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: 73 (🔴 down 14 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 project configuration.

@chenjiahan chenjiahan changed the title fix: correct environment check fix: correct environment check for filename template Jun 24, 2025
@chenjiahan chenjiahan changed the title fix: correct environment check for filename template fix: correct environment check for devtool filename template Jun 24, 2025
Copy link
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 replaces the previous NODE_ENV string check with the isDev flag for setting devtoolModuleFilenameTemplate, ensuring more accurate environment detection.

  • switch environment check from env === 'development' to isDev
  • remove unused env parameter from modifyBundlerChain callback
  • update snapshot to include devtoolModuleFilenameTemplate

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/core/src/plugins/basic.ts Use isDev instead of env for the source-map filename template
packages/core/tests/snapshots/default.test.ts.snap Add devtoolModuleFilenameTemplate entry to the default snapshot
Comments suppressed due to low confidence (1)

packages/core/src/plugins/basic.ts:85

  • Consider adding a test case for the production scenario (isDev = false) to verify that devtoolModuleFilenameTemplate is not set when not in development mode.
        if (isDev) {

@chenjiahan chenjiahan merged commit 91cecb5 into main Jun 24, 2025
14 checks passed
@chenjiahan chenjiahan deleted the env_check_0624 branch June 24, 2025 14:42
@chenjiahan chenjiahan mentioned this pull request Jun 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.

1 participant