Improve comments stripping in compress

Ignore comment during compress if starts with exclamation mark
This commit is contained in:
Roman Ožana
2013-03-27 12:38:27 +01:00
committed by Luke Page
parent 9de0e30c64
commit 77966d4457

View File

@@ -8,7 +8,9 @@ tree.Comment = function (value, silent, index, currentFileInfo) {
tree.Comment.prototype = {
type: "Comment",
toCSS: function (env) {
return (env.compress || (this.currentFileInfo && this.currentFileInfo.reference && !this.isReferenced)) ? '' : this.value;
var isReference = (this.currentFileInfo && this.currentFileInfo.reference && !this.isReferenced),
isCompressed = env.compress && !this.value.match(/^\/\*!/);
return (isReference || isCompressed) ? '' : this.value;
},
eval: function () { return this; },
markReferenced: function () {