You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ha...@apache.org on 2018/09/05 08:38:17 UTC

[royale-compiler] branch develop updated: Remove empty selectors on minification

This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git


The following commit(s) were added to refs/heads/develop by this push:
     new b744a2d  Remove empty selectors on minification
b744a2d is described below

commit b744a2d392567b1b128e7571b402c924892f9d1d
Author: Harbs <ha...@in-tools.com>
AuthorDate: Wed Sep 5 11:38:06 2018 +0300

    Remove empty selectors on minification
---
 .../compiler/internal/driver/js/royale/JSCSSCompilationSession.java     | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java
index cf9553e..3a42aba 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java
@@ -93,6 +93,8 @@ public class JSCSSCompilationSession extends CSSCompilationSession
      */
     public static String minifyCSSString(String cssString)
     {
+        //Remove empty selectors
+        cssString = cssString.replaceAll("\\S+\\s?{[\\s\\n]+}", "");
         // Remove comments
         cssString = cssString.replaceAll("/\\*[\\d\\D]*?\\*/", "");
         cssString = cssString.replace(";}", "}");