Does the locations section of an asset allow for multiple locations?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Does the locations section of an asset allow for multiple locations?

arnaldop
I'm wondering if the locations section of an asset inside of a bundle allows for multiple locations for the same asset?

If so, will each location be tried in succession until a working one is found?

For example, I want to use CDN assets. However, from time to time I have to work offline. This requires me to have local versions of my assets (for which I use webjars).

Can I do something like this?

{
    "bundle" : "my-bundle",
    "assets": [
        {
            "name": "XYZ",
            "version": "1.9.4",
            "type": "js",
            "locations": {
                "cdn": "<CDN URL to asset>"
                "webapp": "<local path to webapp asset>"
            }
        }
    ]
}

And if I can do this, will it try the CDN first, and if that is inaccessible, will it place the webapp asset on my page instead?

Please advise.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does the locations section of an asset allow for multiple locations?

Thibault Duchateau
Administrator
This post was updated on .
Hi again,

Funny, you're the first to ask since the release of the v0.10.0. :-)

This feature was initially designed to work as you've mentioned, i.e. as a fallback mechanism. But it's actually not used and will be removed in upcoming versions and replaced by a smarter mechanism, allowing you to switch locations between multiple environments (dev, QA, prod, ...).

So in short, just don't use it. ;-)

Regards,
Thibault.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does the locations section of an asset allow for multiple locations?

arnaldop
Thanks for the clarification!

I am really enjoying this project. It's helping me simplify my code!

Keep up the great work!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does the locations section of an asset allow for multiple locations?

Thibault Duchateau
Administrator
You're welcome.

Thanks! <3
Loading...