Skip to content

chore: simplify source map template to string literal#6472

Merged
chenjiahan merged 1 commit intomainfrom
simlify_template_1031
Oct 31, 2025
Merged

chore: simplify source map template to string literal#6472
chenjiahan merged 1 commit intomainfrom
simlify_template_1031

Conversation

@chenjiahan
Copy link
Member

Summary

Replace the devtoolModuleFilenameTemplate function with a string literal [absolute-resource-path] to simplify the config.

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings October 31, 2025 05:50
@netlify
Copy link

netlify bot commented Oct 31, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit f370938
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/69044e313f1b4b000879dcad
😎 Deploy Preview https://deploy-preview-6472--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: 64 (🟢 up 1 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.

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 refactors the devtoolModuleFilenameTemplate configuration from a function to a string template literal. The change simplifies the code by using webpack/rspack's built-in template string [absolute-resource-path] instead of a custom function that returned absoluteResourcePath.

  • Replaced function-based template with string literal template [absolute-resource-path]
  • Updated constant naming from sourceMapFilenameTemplate to DEFAULT_SOURCE_MAP_TEMPLATE
  • Updated all test snapshots to reflect the new string template format

Reviewed Changes

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

Show a summary per file
File Description
packages/core/src/plugins/sourceMap.ts Refactored source map template from function to string literal
packages/core/tests/snapshots/environments.test.ts.snap Updated snapshot to show string template instead of [Function]
packages/core/tests/snapshots/default.test.ts.snap Updated snapshot to show string template instead of [Function]
packages/core/tests/snapshots/builder.test.ts.snap Updated snapshot to show string template instead of [Function]
packages/compat/webpack/tests/snapshots/default.test.ts.snap Updated snapshot to show string template instead of [Function]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit 5722816 into main Oct 31, 2025
18 checks passed
@chenjiahan chenjiahan deleted the simlify_template_1031 branch October 31, 2025 05:59
@chenjiahan chenjiahan mentioned this pull request Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant