Skip to content

Instantly share code, notes, and snippets.

@KELiON
Created July 16, 2014 09:45
Show Gist options
  • Save KELiON/f400d747008e351b636d to your computer and use it in GitHub Desktop.
Save KELiON/f400d747008e351b636d to your computer and use it in GitHub Desktop.
Compile all assets from roots
# Precompile all JS/CSS in root of app/assets/stylesheets and app/assets/javascripts
config.assets.precompile +=
Dir[::Rails.root.join('app/assets/*/*.{js,css,coffee,sass,scss}*')].
map { |i| File.basename(i).sub(/(\.js)?\.coffee$/, '.js') }.
map { |i| File.basename(i).sub(/(\.css)?\.(sass|scss)$/, '.css') }.
reject { |i| i =~ /^application\.(js|css)$/ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment