Commit e19e9a3a authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Compress CSS file when exporting.

Use a hackish way to locate yui-compressor relative to sencha command.
parent a1fdcc07
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -167,7 +167,12 @@ def combine_css(html, base_dir)
    end
  end

  File.open("#{OUT_DIR}/resources/css/app.css", 'w') {|f| f.write(css.join("\n")) }
  fname = "#{OUT_DIR}/resources/css/app.css"
  File.open(fname, 'w') {|f| f.write(css.join("\n")) }

  # Compress the CSS in-place
  system "java -jar $(dirname $(which sencha))/../jsbuilder/ycompressor/ycompressor.jar -o #{fname} #{fname}"

  html.sub(css_section_re, '<link rel="stylesheet" href="resources/css/app.css" type="text/css" />')
end