From b1cf7857030d7a6f01b1e967995df1e6857cc70e Mon Sep 17 00:00:00 2001 From: Alex King Date: Wed, 22 Feb 2017 12:43:17 +0000 Subject: [PATCH] fix(sourcemap-regex): fix regex to match browserify sorucemap charset 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 --- tasks/lib/sourcemap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/lib/sourcemap.js b/tasks/lib/sourcemap.js index 6c36473..a381179 100644 --- a/tasks/lib/sourcemap.js +++ b/tasks/lib/sourcemap.js @@ -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();