Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sourcemap.js #130

Merged
merged 1 commit into from
Dec 11, 2015
Merged

Update sourcemap.js #130

merged 1 commit into from
Dec 11, 2015

Conversation

ifrim
Copy link
Contributor

@ifrim ifrim commented Jul 13, 2015

browserify with debug:true stores a sourcemap at the end of the file as a datauri

sometimes the datauri is prefixed with "data:application/json;base64," and sometimes with data:application/json;charset:utf-8;base64,

changed the regexp at line 112 to account for the difference

@stefan--
Copy link

this PR solves #144.

@stefan-- stefan-- mentioned this pull request Dec 11, 2015
stefan-- pushed a commit to stefan--/grunt-contrib-concat that referenced this pull request Dec 11, 2015
vladikoff added a commit that referenced this pull request Dec 11, 2015
@vladikoff vladikoff merged commit 64ccc43 into gruntjs:master Dec 11, 2015
@mikegioia
Copy link

@vladikoff Would you be able to bump the version so that I can pull this into my project? I'm experiencing the same bug during sourcemap creation and this patch solves it. I just have to manually edit the concat library file right now. Thanks for any help.

@c-f-h
Copy link

c-f-h commented Mar 9, 2016

This broke again since Browserify changed from "charset:" to "charset=". Wtf, guys.

I fixed it by changing the regex to allow an arbitrary character in that position:

if (/data:application\/json;(charset.utf-8;)?base64,([^\s]+)/.test(sourceMapFile)) {

This whole code just feels way too brittle, but I don't even know if there is an official specification for what is valid after sourceMappingURL=...

alexjking added a commit to alexjking/grunt-contrib-concat that referenced this pull request Feb 22, 2017
Browserify has changed the sourcemap charset to use `=` instead of `:`.
This has frequently changed, so this fix changes the regex to match a
single character `.`
For reference:
https://github.com/substack/node-browserify/blob/b2374cef35072e7690ab31a68664b0733c1b4995/changelog.markdown#1200

Fixes gruntjs#130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants