Skip to content

Instantly share code, notes, and snippets.

@assembler
Created September 28, 2011 09:42
Show Gist options
  • Save assembler/1247495 to your computer and use it in GitHub Desktop.
Save assembler/1247495 to your computer and use it in GitHub Desktop.
Rake task for asset precompiling
namespace :yourapp do
desc "Precompiles assets"
task :precompile_assets do
ENV["RAILS_GROUPS"] = ENV['RAILS_ENV'] = 'development'
Rake::Task["environment"].invoke
YourApp::Application.configure do
config.assets.debug = false
config.assets.compress = true
config.assets.compile = true
config.assets.digest = true
config.assets.precompile = [ /^(?:(?!js|css).)+$/, /application.(css|js)$/ ]
config.sass.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
end
Rake::Task["assets:precompile"].invoke
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment