Gildas пре 6 година
родитељ
комит
6a9b9ecb85
1 измењених фајлова са 12 додато и 12 уклоњено
  1. 12 12
      lib/single-file/modules/css-rules-minifier.js

+ 12 - 12
lib/single-file/modules/css-rules-minifier.js

@@ -35,20 +35,20 @@ this.cssRulesMinifier = this.cssRulesMinifier || (() => {
 					const stats = { processed: 0, discarded: 0 };
 					let sheetIndex = 0;
 					stylesheets.forEach(stylesheetInfo => {
-						let mediaInfo;
-						if (stylesheetInfo.mediaText && stylesheetInfo.mediaText != "all") {
-							mediaInfo = mediaAllInfo.medias.get("style-" + sheetIndex + "-" + stylesheetInfo.mediaText);
-						} else {
-							mediaInfo = mediaAllInfo;
-						}
-						const cssRules = stylesheetInfo.stylesheet.children;
-						if (cssRules) {
-							stats.processed += cssRules.getSize();
-							stats.discarded += cssRules.getSize();
-							if (!stylesheetInfo.scoped) {
+						if (!stylesheetInfo.scoped) {
+							const cssRules = stylesheetInfo.stylesheet.children;
+							if (cssRules) {
+								stats.processed += cssRules.getSize();
+								stats.discarded += cssRules.getSize();
+								let mediaInfo;
+								if (stylesheetInfo.mediaText && stylesheetInfo.mediaText != "all") {
+									mediaInfo = mediaAllInfo.medias.get("style-" + sheetIndex + "-" + stylesheetInfo.mediaText);
+								} else {
+									mediaInfo = mediaAllInfo;
+								}
 								processRules(cssRules, sheetIndex, mediaInfo);
+								stats.discarded -= cssRules.getSize();
 							}
-							stats.discarded -= cssRules.getSize();
 						}
 						sheetIndex++;
 					});