gulp-locale-filter
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -8,3 +8,3 @@ "use strict"; | ||
var plugin_config_1 = require("../plugin-config"); | ||
var mapFileCommentRegex = /(?:(\/\/[@#][ \t]+sourceMappingURL=)([^\s'"]+?)([ \t]*)$)|(?:(\/\*[@#][ \t]+sourceMappingURL=)([^\*]+?)([ \t]*\*\/[ \t]*)$)/gm; | ||
var mapFileCommentRegex = /(?:(\/\/[@#][ \t]+sourceMappingURL=\/?)([^\s'"]+?)([ \t]*)$)|(?:(\/\*[@#][ \t]+sourceMappingURL=\/?)([^\*]+?)([ \t]*\*\/[ \t]*)$)/gm; | ||
/** | ||
@@ -66,6 +66,11 @@ * Represents the command. | ||
var contents = file.contents.toString(); | ||
contents = contents.replace(mapFileCommentRegex, function (match, before, mapFilePath, after) { | ||
if (mapFilePath.trim() === path.basename(file.path) + ".map") { | ||
return before + (path.basename(basePath_1) + ".map") + after; | ||
contents = contents.replace(mapFileCommentRegex, function (match) { | ||
var groups = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
groups[_i - 1] = arguments[_i]; | ||
} | ||
var offset = groups[0] != null ? 0 : 3; | ||
if (groups[offset + 1] === path.basename(file.path) + ".map") { | ||
return groups[offset] + (path.basename(basePath_1) + ".map") + groups[offset + 2]; | ||
} | ||
return match; | ||
@@ -72,0 +77,0 @@ }); |
{ | ||
"name": "gulp-locale-filter", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Gulp plugin that filters files in the stream based on locale or language codes in the file paths.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
49217
845