Closed danielepolencic closed 10 years ago
I found the answer myself. It's a pity this is not in the documentation, but rather buried in the tests.
For the next me, here's the code I'm referring to:
assets {
serve '/css', :from => 'app/css'
serve '/js', :from => 'app/js'
serve '/images', :from => 'app/images'
asset_hosts [
'//cdn-0.example.org',
'//cdn-1.example.org'
]
css :a, ["/css/style.css"]
js :b, ["/js/hello.js"]
}
perhaps it should be added to the documentation?! shall I propose a pull request?
Yes you should propose improvement to the README regarding this, I'll merge without hesitation!
v.0.1.4 added support for multiple host but the documentation wasn't updated accordingly.
https://github.com/rstacruz/sinatra-assetpack/blob/master/CHANGELOG.md#v014---feb-12-2013
At the moment, using sinatra-assets pack in production generates the following
<link>
and<script>
tags:Is it possible to generate full absolute URLs, so that the assets could be served by CDN? Eg:
Thanks