Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

sgnl
Copy link

@sgnl sgnl commented Nov 22, 2014

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.

nelsonpecora and others added 5 commits November 21, 2014 15:16
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert.notStrictEqual

Copy link
Contributor

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add it.

@sgnl
Copy link
Author

sgnl commented Nov 27, 2014

Found issue where sourcemap is not being rev'd if it's not in the same directory

@sgnl
Copy link
Author

sgnl commented Nov 28, 2014

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.

@sindresorhus
Copy link
Member

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.

@sgnl
Copy link
Author

sgnl commented Nov 29, 2014

Im referring to #62.

@nelsonpecora
Copy link
Contributor

Huh, I didn't know people used base64-encoded sourcemaps. That's kinda nifty I guess.

@nelsonpecora
Copy link
Contributor

Hey @sgnl any update on this?

@sgnl
Copy link
Author

sgnl commented Jan 10, 2015

Currently, I have my code working for me on my own project right now. If there is anything that needs to be changed LMK!

@jtheoof
Copy link

jtheoof commented Feb 12, 2015

This issue is bugging me as well. Why has it not been merged yet?

@nelsonpecora
Copy link
Contributor

@sindresorhus updated PR that doesn't use our own regex #80

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After rename a sourcemap, sourceMappingURL should be updated with the new map file
4 participants