Commits

Jiangge Zhang committed a498a38

compress the scripts and stylesheets.

  • Participants
  • Parent commits 1602808

Comments (0)

Files changed (5)

File passwood/assets/__init__.py

 from .scripts import default_scripts, foundation_scripts
 from .stylesheets import default_stylesheets
-from .processors import stylus, coffee
+from .processors import stylus, coffee, jsmin
 
 
 def register_bundles(compressor):
 def register_processors(compressor):
     compressor.register_processor(stylus)
     compressor.register_processor(coffee)
+    compressor.register_processor(jsmin)

File passwood/assets/processors.py

 import subprocess
 
+from jsmin import jsmin
 from flask.ext.compressor.processors import CompressorProcessorException
 
 
+__all__ = ["stylus", "coffee", "jsmin"]
+
+
 def stylus(content):
     return execute_command("stylus", content=content)
 

File passwood/assets/scripts.py

     FileAsset(filename="bundles/modernizr/modernizr.js"),
     FileAsset(filename="bundles/jquery/jquery.js"),
     FileAsset(filename="scripts/login.coffee", processors=["coffee"]),
-])
+], processors=["jsmin"])
 foundation_scripts = JSBundle("foundation_scripts", assets=[
     FileAsset(filename="bundles/foundation/js/foundation.js"),
     Asset(content="$(document).foundation()", processors=["coffee"]),
-])
+], processors=["jsmin"])

File passwood/assets/stylesheets.py

 default_stylesheets = CSSBundle("default_stylesheets", assets=[
     FileAsset(filename="bundles/foundation/css/foundation.css"),
     FileAsset(filename="stylesheets/login.styl", processors=["stylus"]),
-])
+], processors=["cssmin"])

File requirements.txt

 blinker==1.3
 cov-core==1.7
 coverage==3.7.1
+cssmin==0.2.0
 execnet==1.1
 itsdangerous==0.23
+jsmin==2.0.8
 passlib==1.6.1
 pep8==1.4.6
 py==1.4.19