Support remote assets in Bundle
Sumukh opened this issue · 1 comments
Sumukh commented
It would be nice to be able to do something like
helper_libs = Bundle('https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.1/moment.min.js',
'static/js/shims.js'
output='public/libs.js')
Here's my current thinking for how this could work:
- webassets would detect it as remote URL and download the raw file (if it doesn't exist yet)
- the rest of the pipeline would continue and the
url
of the file for the rest of the process is the download location - tracking for changes is detecting changes on the URL.
If this isn't a goal of webassets/not a good fit - it looks easy enough to do as an extension/separate library.
I'd welcome implementation suggestions. My current implementation that doesn't touch the internals of webassets creates a subclass of Bundle (WebBundle
) and defines the _urls
method.
miracle2k commented
URLs are already supported; the limitation is that they are currently always fetched. We don't query for etags or something similar.