0
votes

Im working in a Rails 4 app. Is there a way to get each complied js/css file that would be served though "javascript_include_tag" and "stylesheet_link_tag" and copy/save it out to a file elsewhere? I hope that question makes sense.

I can of course go into "app/assets/javascripts" and "app/assets/stylesheets" and copy files from there but application for instance has "require" statements like "//= require jquery" and such that wouldnt be imported because the file isnt processed.

Anyone know how this can be done? Thanks!

2

2 Answers

0
votes

rake assets:precompile will precompile your assets and put them into public/asssets.

0
votes

You should be able to do this by using the assets precompile script, as suggested by this question.

First edit your development.rb environment file to remove the line

config.serve_static_assets = false

Then run rake assets:precompile and you should have a full set of JS and CSS in your public/assets/ directory.