grunt-html-build
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -11,2 +11,3 @@ module.exports = function (grunt) { | ||
beautify: true, | ||
//parseTag: 'htmlbuild', | ||
scripts: { | ||
@@ -13,0 +14,0 @@ bundle: [ |
{ | ||
"name": "grunt-html-build", | ||
"description": "Grunt HTML Builder - Appends scripts and styles, Removes debug parts, append html partials, Template options", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"homepage": "https://github.com/spatools/grunt-html-build.git", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -161,2 +161,3 @@ grunt-html-build | ||
* 0.1.4 Fixing nodejs dependencies | ||
* 0.1.5 Optimize src loop / Fix js-beautify options | ||
* 0.1.5 Optimize src loop / Fix js-beautify options | ||
* 0.1.6 Allow build tag customization |
@@ -42,4 +42,4 @@ /* | ||
// Tags Regular Expressions | ||
regexTagStart = /<!--\s*build:(\w+)\s*(inline)?\s*(optional)?\s*([^\s]*)\s*-->/, // <!-- build:{type} [inline] [optional] {name} --> {} required [] optional | ||
regexTagEnd = /<!--\s*\/build\s*-->/; // <!-- /build --> | ||
regexTagStart = "<!--\\s*%parseTag%:(\\w+)\\s*(inline)?\\s*(optional)?\\s*([^\\s]*)\\s*-->", // <!-- build:{type} [inline] [optional] {name} --> {} required [] optional | ||
regexTagEnd = "<!--\\s*\\/%parseTag%\\s*-->"; // <!-- /build --> | ||
@@ -57,4 +57,4 @@ //#endregion | ||
lines.forEach(function (l) { | ||
var tagStart = l.match(regexTagStart), | ||
tagEnd = regexTagEnd.test(l); | ||
var tagStart = l.match(new RegExp(regexTagStart)), | ||
tagEnd = new RegExp(regexTagEnd).test(l); | ||
@@ -100,2 +100,7 @@ if (tagStart) { | ||
function setTagRegexes(parseTag) { | ||
regexTagStart = regexTagStart.replace(/%parseTag%/, parseTag); | ||
regexTagEnd = regexTagEnd.replace(/%parseTag%/, parseTag); | ||
} | ||
//#endregion | ||
@@ -168,4 +173,4 @@ | ||
.join(EOL) | ||
.replace(regexTagStart, "") | ||
.replace(regexTagEnd, ""); | ||
.replace(new RegExp(regexTagStart), "") | ||
.replace(new RegExp(regexTagEnd), ""); | ||
}, | ||
@@ -192,5 +197,8 @@ remove: function (options) { | ||
sections: {}, | ||
data: {} | ||
data: {}, | ||
parseTag: 'build' | ||
}); | ||
setTagRegexes(params.parseTag); | ||
this.files.forEach(function (file) { | ||
@@ -240,2 +248,2 @@ var dest = file.dest || "", | ||
}); | ||
}; | ||
}; |
36573
251
162