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

update the sourceMappingURL (now with tests!) #68

Closed
wants to merge 1 commit into from
Closed

update the sourceMappingURL (now with tests!) #68

wants to merge 1 commit into from

Conversation

nelsonpecora
Copy link
Contributor

updated ncthis's PR #67 to use grunt file api methods, added tests (fixes #62)


// rewrite the sourceMappingURL in files
var fileContents = grunt.file.read(resultPath, {encoding: 'utf8'});
var newSrcMap = fileContents.replace('//# sourceMappingURL=' + path.basename(file) + '.map', '//# sourceMappingURL=' + path.basename(resultPathMap));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is now much less greedy

@ironspecs
Copy link

+1

1 similar comment
@sgnl
Copy link

sgnl commented Nov 22, 2014

👍

@sgnl
Copy link

sgnl commented Nov 22, 2014

Just wondering, should the file reference inside of the souce map file be changed as well?

it's at the "file" property of the .map file created.

@ironspecs
Copy link

I was wondering about that too. When it's served up, it's the browser that uses the sourcemap path inside the mapped file to find the map, right? The rev is stripped off by then, maybe?

@nelsonpecora
Copy link
Contributor Author

👍 @sgnl that's a good idea. I'm also not sure how the browsers handle the references in the sourcemap itself, but I'll do some experimenting.

@jtheoof
Copy link

jtheoof commented Feb 12, 2015

👍

@charlespina
Copy link

Any news ? Seems like yoshokatana addressed the issues in ncthis's PR. Is there anything outstanding?

@jtheoof
Copy link

jtheoof commented Mar 19, 2015

I agree, I do not see what's holding things here.

@kevva
Copy link
Member

kevva commented Mar 20, 2015

Can you fix merge conflicts?

@nelsonpecora
Copy link
Contributor Author

Roger, will do.

EDIT: It doesn't seem like I can pull this commit down, as it's not part of my fork.

@kevva
Copy link
Member

kevva commented Mar 20, 2015

$ git remote add source https://github.com/yeoman/grunt-filerev.git
$ git pull --rebase source master

@nelsonpecora
Copy link
Contributor Author

I couldn't seem to checkout the specific commit from this PR, so here's an updated one (with an updated test): #79

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
6 participants