Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.2k
feat: consolidated sourceMap-related fields indevtool#19485
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| } | ||
| } | ||
| F(options,"devtool",()=>(development ?"eval" :false)); |
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.
We put it after makingoptions.output default b/c we rely onoutput.uniqueName
42ee44e to9908283Comparecodspeed-hqbot commentedMay 1, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#19485 willdegrade performances by 10.48%Comparing Summary
Benchmarks breakdown
|
27ec59a to2ed2eacComparelib/WebpackOptionsApply.js Outdated
| constcheap=devtool.type.includes("cheap"); | ||
| constmoduleMaps=devtool.type.includes("module"); | ||
| constnoSources=devtool.type.includes("nosources"); | ||
| constdebugIds=devtool.type.includes("debugids"); |
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.
Ideally we should do it innormalization.js, so indefault.js we will already have object, but I am afraid it can be breaking change, because some developers can rely onoutput.devtool as a string.
There is a good question should we want to supportdevtool: string in future, if yes - code looks good, if no - we need to addTODO.
I'm actually in favor of supporting the string value in the future.
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.
I'm actually in favor of supporting the string value in the future.
Me too. I think it's not too bad to still supportingdevtool: string. So user can easily setting whendevelopment and as far as I know, if need to generate production sourcemaps they usually use plugin.
| namespace:options.output.devtoolNamespace, | ||
| namespace, | ||
| debugIds | ||
| }).apply(compiler); |
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.
So we don't allow to providecolumns/debugIds/etc values in the object notation or you want to finish it after this PR?
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.
Currently,columns anddebugIds depend on thedevtool setting (i.e., devtool.includes("cheap") / "debugids").
Yeah, separating them into a dedicated field is a good idea - but should we still support specifying them via string literals or bydevtool.type (e.g., cheap-xxx, debugids-xxx)?
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.
I think it makes sense only for an object notation, we already have string values which cover every option
172c0bf tod98ffbfCompare…lability and improve DX
d98ffbf to6012ee0Compare
alexander-akait left a comment
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.
Looks good, can we add a couple simple test cases?
Uh oh!
There was an error while loading.Please reload this page.
evenstensberg left a comment
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.
lgtm
Uh oh!
There was an error while loading.Please reload this page.
What kind of change does this PR introduce?
Follows#19389 (comment) Step 1.
Consolidated SourceMap-related fields under
devtoolto enhance scalability and improve developer experience (DX). Now, devtool can be defined using an object literal, like so:Did you add tests for your changes?
Yes
Does this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
object notation of
devtool