Fix incorrect webpack devTool value #4265
Closed
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 have been trying to get source maps to work with Phoenix, and I noticed that the default
devTool
option is incorrect, I think?phoenix/installer/templates/phx_assets/webpack.config.js
Line 27 in c8883af
It seems that it's set to a webpack 5 value, while Phoenix still uses webpack 4.
WP5: https://webpack.js.org/configuration/devtool/#devtool, has
eval-cheap-module-source-map
.WP4: https://v4.webpack.js.org/configuration/devtool/#devtool, no
eval-cheap-module-source-map
option, perhaps intended to usecheap-module-eval-source-map
?The weird thing is that I was still seeing source maps like behaviour in the browser, maybe webpack defaults to a safe value if it doesn't recognise the key?
At any rate, I wasn't actually able to click though to code lines without setting the value to
eval-source-map
(that is, setting it to the maybe-intended value,cheap-module-eval-source-map
, didn't seem useful).The webpack docs listed as "fast", vs "faster", but no real indication of exactly how much faster. I certainly couldn't tell between them but I don't have multi MB of JS.
eval-source-map
seems like a good pick by the docs: