Cache bust source map fixup - #4972
Conversation
| const sourceMapUrl = path.relative(path.dirname(file), sourceMapFile).replace(/\\/g, "/"); | ||
| let sourceMapUrl = path.relative(path.dirname(file), sourceMapFile).replace(/\\/g, "/"); | ||
| if(sourceMapFilename.indexOf("?[contenthash]") !== -1) { | ||
| sourceMapUrl += "?" + crypto.createHash("md5").update(source).digest("hex"); |
There was a problem hiding this comment.
use replace(/\[contenthash\]/g, ...) instead.
| }); | ||
| const sourceMapUrl = path.relative(path.dirname(file), sourceMapFile).replace(/\\/g, "/"); | ||
| let sourceMapUrl = path.relative(path.dirname(file), sourceMapFile).replace(/\\/g, "/"); | ||
| if(sourceMapFilename.indexOf("?[contenthash]") !== -1) { |
There was a problem hiding this comment.
if(sourceMapFilename.indexOf("[contenthash]") !== -1) {
db0bdad to
f9d3cce
Compare
|
Outside topic, but your bot message
I recommend creating a team and have the bot notify the team about new changes. Example:
|
| const sourceMapUrl = path.relative(path.dirname(file), sourceMapFile).replace(/\\/g, "/"); | ||
| let sourceMapUrl = path.relative(path.dirname(file), sourceMapFile).replace(/\\/g, "/"); | ||
| if(sourceMapUrl.indexOf("[contenthash]") !== -1) { | ||
| sourceMapUrl = sourceMapUrl.replace("[contenthash]", crypto.createHash("md5").update(source).digest("hex")); |
There was a problem hiding this comment.
Use a regexp instead to replace every occurrence.
replace(/\[contenthash\]/g,
| "use strict"; | ||
|
|
||
| const path = require("path"); | ||
| var crypto = require("crypto"); |
f9d3cce to
0611b63
Compare
0611b63 to
afa7702
Compare
…ul workaround for this bug in chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=508270
afa7702 to
84b6554
Compare
|
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
|
CI keeps failing. I don't know if I should be concerned about some of those failing. |
only 1 of 3 CIs fail... that's ok... one of them is always broken, that's why we have 3 of them... |
What kind of change does this PR introduce?
Feature
Did you add tests for your changes?
Yes
If relevant, link to documentation update:
Replaces #4137
Summary
The PR is based on a useful feature introduced by the aforementioned PR, but that PR was not updated to address PR concerns. I am trying to finish the work started.
Does this PR introduce a breaking change?
No breaking changes. Only augmentation.
Tried to contact author of original PR but no response. I prefer to get this in sooner than later.