-
Notifications
You must be signed in to change notification settings - Fork 73
Updated PR#68 to also change the file reference inside of a source map file to point to file revisioned source file; updates a test #69
base: master
Are you sure you want to change the base?
Conversation
…file and also updates original file reference inside of source map file.
… to file revisioned path; Update test which checks if the file revision numbers match for both the javascript file and it's source map file.
var file = 'test/fixtures/math.js'; | ||
var map = 'math.2f56179e.js.map'; | ||
var revisioned = fs.readFileSync(hashes[file], {encoding: 'utf8'}); | ||
assert(revisioned.indexOf('//# sourceMappingURL=' + map) !== -1); |
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.
assert.notStrictEqual
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.
ah, I wasn't aware of that. @sgnl would you mind making that change?
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'll add it.
…ave it as a default value
… and relative paths
… if name included the "-" character
Found issue where sourcemap is not being rev'd if it's not in the same directory |
so, if I remove the part where it renames the file property's value in the source map it would be okay, right? the issue I was originally trying to solve is that when file-rev renames both the file and the source map, the comment in the .js or .css file should point to the rev'd source file. |
No idea what you're talking about, but my comment was referring to your home-made regex and that it's better to use an existing module for handling sourcemap comment rewriting. |
Im referring to #62. |
Huh, I didn't know people used base64-encoded sourcemaps. That's kinda nifty I guess. |
Hey @sgnl any update on this? |
Currently, I have my code working for me on my own project right now. If there is anything that needs to be changed LMK! |
This issue is bugging me as well. Why has it not been merged yet? |
@sindresorhus updated PR that doesn't use our own regex #80 |
Updates pull-request #68, (fixes #62)
I thought the file reference in the source map file should point back to the file it's mapping.
Doing so, my code triggered the test
'should use same revision as .js source for the .map'
to fail. I refactored it in a way that I think should be fine?This code also introduces NodeJS Path Module to the tests.