Commits

Felix Krull committed b27e98b

Allow to disable minification.

Comments (0)

Files changed (1)

 
 from scanner.TreeWalker import TreeWalker
 
+NO_MINIFY = True
+
 def checked_build(rule, target, dependencies):
     def do_build():
         print(" ".join(os.path.basename(d) for d in dependencies),
 
 
 def minify_js(target, dependencies):
-    try:
-        import slimit
-        manglefunc = slimit.minify
-    except ImportError:
-        print("  no slimit, not minifying javascript")
+    if NO_MINIFY:
+        print("  minifying disabled")
         manglefunc = None
+    else:
+        try:
+            import slimit
+            manglefunc = slimit.minify
+        except ImportError:
+            print("  no slimit, not minifying javascript")
+            manglefunc = None
     textcat(target, dependencies, manglefunc)
 
 
 def minify_css(target, dependencies):
-    try:
-        import cssmin
-        manglefunc = cssmin.cssmin
-    except ImportError:
-        print("  no cssmin, not minifying CSS")
+    if NO_MINIFY:
+        print("  minifying disabled")
         manglefunc = None
+    else:
+        try:
+            import cssmin
+            manglefunc = cssmin.cssmin
+        except ImportError:
+            print("  no cssmin, not minifying CSS")
+            manglefunc = None
     textcat(target, dependencies, manglefunc)