-
Notifications
You must be signed in to change notification settings - Fork 14
feat(rsbuild): Enable source map in production #2896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,7 +73,9 @@ function getRsbuildConfig({ | |
| auto: resource => resource.endsWith('.styl') | ||
| }, | ||
| // We enable old API polyfill to keep compatibility with old browsers | ||
| polyfill: 'usage' | ||
| polyfill: 'usage', | ||
| // We enable source map to simplify production debugging | ||
| sourceMap: true | ||
|
Comment on lines
+76
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not serve source maps to end users; generate and upload to Sentry separately. Rsbuild documentation explicitly warns: "Do not deploy source maps (.map files) to the public web server or CDN when using values such as source-map or hidden-source-map in production builds. Public source maps will expose your source code and may bring security risks." Generating source maps may expose them to the public, potentially causing your source code to be leaked, even for open-source projects, as it reveals internal implementation patterns, debug logic, and commented code. Recommended approach:
|
||
| }, | ||
| performance: { | ||
| chunkSplit: { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Getting worse: Large Method
getRsbuildConfig increases from 199 to 200 lines of code, threshold = 70
Suppress