Allow overriding webpack's devtool setting #6027
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've noticed that incremental builds are starting to get slow again which is a drain on (my) productivity.
Changing webpack's
devtool
setting fromsource-map
tocheap-module-eval-source-map
brings down the time for an incremental build on my machine from ~1500 ms to < 500 ms.This PR allows one to override this setting with an environment variable so that folks that want to trade sourcemap quality for build speed can go ahead and do that.
I chose
SOURCEMAP
as the name of this variable so as to match Calypso, but it could just as easily be namedDEVTOOL
.Useful reading: https://webpack.js.org/configuration/devtool/
Related PRs: #4537 #5931
How to test
Fire up your terminal and run this:
Then, make some code changes. Notice that incremental builds are quick.
Questions
eval-source-map
since it produces source maps that are of the same quality as what we currently have, but with a faster incremental build time.CONTRIBUTING.md
might be too intimidating.