Permalink
Browse files

Merge pull request #6 from smgt/compress-js

Compress the js with uglify js when running the rake task
  • Loading branch information...
2 parents 64df113 + 6c7f155 commit cc7c44476bea6e8a973a043efa5fe3e36c20ce9e @maccman committed Mar 19, 2013
Showing with 8 additions and 1 deletion.
  1. +1 −0 Gemfile
  2. +4 −0 Gemfile.lock
  3. +3 −1 Rakefile
View
@@ -10,5 +10,6 @@ gem 'useragent'
gem 'erubis'
gem 'sprockets'
gem 'sprockets-commonjs'
+gem 'uglifier'
gem 'coffee-script'
gem 'stylus'
View
@@ -70,6 +70,9 @@ GEM
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
tilt (1.3.3)
+ uglifier (1.3.0)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.0, >= 1.0.2)
useragent (0.4.16)
PLATFORMS
@@ -87,4 +90,5 @@ DEPENDENCIES
sprockets-commonjs
stylus
thin
+ uglifier
useragent
View
@@ -2,13 +2,15 @@ namespace :assets do
task :precompile do
require 'fileutils'
require 'sprockets'
+ require 'uglifier'
sprockets = Sprockets::Environment.new
+ sprockets.js_compressor = Uglifier.new
sprockets.append_path('app/assets/javascripts')
FileUtils.mkdir_p('public/v1')
File.open('public/v1/abba.js', 'w+') do |file|
file.write sprockets['client/index'].to_s
end
end
-end
+end

0 comments on commit cc7c444

Please sign in to comment.