Skip to content

Commit

Permalink
fix(sourcemap-regex): fix regex to match browserify sorucemap charset
Browse files Browse the repository at this point in the history
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 #130
  • Loading branch information
alexjking committed Feb 22, 2017
1 parent dcc347f commit b1cf785
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/lib/sourcemap.js
Expand Up @@ -146,7 +146,7 @@ exports.init = function(grunt) {

var sourceContent;
// Browserify, as an example, stores a datauri at sourceMappingURL.
if (/data:application\/json;(charset:utf-8;)?base64,([^\s]+)/.test(sourceMapFile)) {
if (/data:application\/json;(charset.utf-8;)?base64,([^\s]+)/.test(sourceMapFile)) {
// Set sourceMapPath to the file that the map is inlined.
sourceMapPath = filename;
sourceContent = new Buffer(RegExp.$2, 'base64').toString();
Expand Down

0 comments on commit b1cf785

Please sign in to comment.