thumblemonks / smurf

Rails plugin to automatically minify JavaScript and CSS when their bundles get cached
http://gusg.us/code/ruby/smurf-rails-autominifying-js-css-plugin.html
MIT License
193 stars 12 forks source link

Can't use with Heroku #8

Closed cbmeeks closed 13 years ago

cbmeeks commented 13 years ago

Heroku is a read only file system. Except for /tmp but they admit that directory could be destroyed at any time.

What I do is change my application.html.erb to:

:all, :cache => true

Then, I load up the production environment, browse to a page, then notice it creates the "all.css" file.

Then, I shut down production (on my laptop) and replace the application.html.erb with "all".

Is there another way to automate this with Heroku? Maybe a rails task that would generate the cached css file?

Thanks

peppyheppy commented 13 years ago

This is a good question. On one app that I work on I have a capistrano recipe generate the files and move them up to s3 with CloudFront.

I haven't tried it, but you could create a rake task that generated the files you want and then you could create a git post-commit that executed the rake task. This way you can automate the manual process that you are currently doing. Does that make sense?

Good luck!

cbmeeks commented 13 years ago

Yep. Thanks for the suggestion.