Skip to content

Commit

Permalink
In BundleTransformer.CleanCss added support of Clean-css version 4.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Taritsyn committed Jun 21, 2017
1 parent 4cc5f49 commit 2b90c64
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
<projectUrl>https://github.com/Taritsyn/BundleTransformer</projectUrl>
<iconUrl>https://raw.githubusercontent.com/Taritsyn/BundleTransformer/master/images/icons/128/BundleTransformer_CleanCss_Logo_128x128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>BundleTransformer.CleanCss contains one minifier-adapter for minification of CSS code - `CleanCssMinifier`. `CleanCssMinifier` is based on the Clean-css (https://github.com/jakubpawlowicz/clean-css) version 4.1.3.
<description>BundleTransformer.CleanCss contains one minifier-adapter for minification of CSS code - `CleanCssMinifier`. `CleanCssMinifier` is based on the Clean-css (https://github.com/jakubpawlowicz/clean-css) version 4.1.4.

As a JS engine is used the JavaScript Engine Switcher library (https://github.com/Taritsyn/JavaScriptEngineSwitcher). For correct working of this module, you need to install one of the following NuGet packages: JavaScriptEngineSwitcher.Msie, JavaScriptEngineSwitcher.V8 or JavaScriptEngineSwitcher.ChakraCore.</description>
<summary>BundleTransformer.CleanCss contains one minifier-adapter for minification of CSS code - `CleanCssMinifier`. `CleanCssMinifier` is based on the Clean-css version 4.1.3.</summary>
<summary>BundleTransformer.CleanCss contains one minifier-adapter for minification of CSS code - `CleanCssMinifier`. `CleanCssMinifier` is based on the Clean-css version 4.1.4.</summary>
<releaseNotes>Added support of Clean-css version 4.1.4.</releaseNotes>
<copyright>Copyright (c) 2012-2017 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
<language>en-US</language>
<tags>BundleTransformer System.Web.Optimization IBundleTransform ASP.NET CSS Bundling Minification Minifier Minify Clean-css</tags>
Expand Down
7 changes: 6 additions & 1 deletion NuGet/BundleTransformer.CleanCss/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
===========
BundleTransformer.CleanCss contains one minifier-adapter for minification of
CSS code - `CleanCssMinifier`. `CleanCssMinifier` is based on the Clean-css
(https://github.com/jakubpawlowicz/clean-css) version 4.1.3.
(https://github.com/jakubpawlowicz/clean-css) version 4.1.4.

As a JS engine is used the JavaScript Engine Switcher library
(https://github.com/Taritsyn/JavaScriptEngineSwitcher).

=============
RELEASE NOTES
=============
Added support of Clean-css version 4.1.4.

====================
POST-INSTALL ACTIONS
====================
Expand Down
27 changes: 18 additions & 9 deletions src/BundleTransformer.CleanCss/Resources/clean-css-combined.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (!String.prototype.hasOwnProperty('repeat')) {
}

/*!
* Clean-css v4.1.3
* Clean-css v4.1.4
* https://github.com/jakubpawlowicz/clean-css
*
* Copyright (C) 2017 JakubPawlowicz.com
Expand Down Expand Up @@ -5582,7 +5582,8 @@ var CleanCss = (function(){
function removeUnusedAtRule(tokens, matchCallback, markCallback, context) {
var atRules = {};
var atRule;
var token;
var atRuleTokens;
var atRuleToken;
var zeroAt;
var i, l;

Expand All @@ -5597,9 +5598,13 @@ var CleanCss = (function(){
markUsedAtRules(tokens, markCallback, atRules, context);

for (atRule in atRules) {
token = atRules[atRule];
zeroAt = token[0] == Token.AT_RULE ? 1 : 2;
token[zeroAt] = [];
atRuleTokens = atRules[atRule];

for (i = 0, l = atRuleTokens.length; i < l; i++) {
atRuleToken = atRuleTokens[i];
zeroAt = atRuleToken[0] == Token.AT_RULE ? 1 : 2;
atRuleToken[zeroAt] = [];
}
}
}

Expand All @@ -5623,7 +5628,8 @@ var CleanCss = (function(){

if (token[0] == Token.AT_RULE_BLOCK && token[1][0][1].indexOf('@counter-style') === 0) {
match = token[1][0][1].split(' ')[1];
atRules[match] = token;
atRules[match] = atRules[match] || [];
atRules[match].push(token);
}
}

Expand Down Expand Up @@ -5665,7 +5671,8 @@ var CleanCss = (function(){

if (property[1][1] == 'font-family') {
match = property[2][1].toLowerCase();
atRules[match] = token;
atRules[match] = atRules[match] || [];
atRules[match].push(token);
break;
}
}
Expand Down Expand Up @@ -5718,7 +5725,8 @@ var CleanCss = (function(){

if (token[0] == Token.NESTED_BLOCK && keyframeRegex.test(token[1][0][1])) {
match = token[1][0][1].split(' ')[1];
atRules[match] = token;
atRules[match] = atRules[match] || [];
atRules[match].push(token);
}
}

Expand Down Expand Up @@ -5763,7 +5771,8 @@ var CleanCss = (function(){

if (token[0] == Token.AT_RULE && token[1].indexOf('@namespace') === 0) {
match = token[1].split(' ')[1];
atRules[match] = token;
atRules[match] = atRules[match] || [];
atRules[match].push(token);
}
}

Expand Down

0 comments on commit 2b90c64

Please sign in to comment.