gulp-rails-pipeline
gulp-rails-pipeline copied to clipboard
Serving assets from CDN
Is it possible to precompile assets and serve them from a CDN instead? I've been using asset_sync with the default rails pipeline and it's been working great.
Yeah, definitely possible. I haven't done it yet personally, but here are some resources to get you started.
This option in rev-collector
https://www.npmjs.com/package/gulp-rev-collector#dirreplacements should let you get your cdn path in there. There are other gulp plugins for uploading. Here are a couple for publishing to amazon web services:
https://www.npmjs.com/package/gulp-s3-upload https://www.npmjs.com/package/gulp-awspublish
As is the project completely ignores asset_host
though right?
Yeah, none of the tasks know about Ruby or Rails.
@rymohr Did you find a way of getting the assets from a CDN? From what I get rev-collector only changes files from html templates but we probably need to get other assets referenced on css also.
@joaovpmamede I haven't actually tried to use this one yet. The project I was hoping to use it for is a production app with 50k lines of js so it won't be an easy migration. Waiting till it's been battle tested a bit more.