Created
September 28, 2011 09:42
-
-
Save assembler/1247495 to your computer and use it in GitHub Desktop.
Rake task for asset precompiling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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