I'm using Sublime Text 2 and the Nettuts Fetch plugin which can fetch resources via a URL, at the moment trying to get the latest version of Modernizr proves difficult as there doesn't seem to be a single URL that would auto server the 'latest' version of this script…
Currently I'm querying the url: "http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.1/modernizr.min.js" directly but the moment 2.6.2 comes out I will still be referencing 2.6.1.
Is there a better way to grab the "latest" of a given library?
Something like: "http://cdnjs.cloudflare.com/ajax/libs/modernizr/latest/modernizr.min.js" where the latest folder would always contain the most up to date version of that lib would be nice.
Any thoughts on this or a better way for me to do what I'd like to do here?
Thanks for reading.
Thanks for the reply Thomas.
I've installed the cdnjs package but noticed that it only adds a script tag with the properly set src attribute to the chosen library file.
While this is nice, I would like to access the contents of said script so that I can quickly dump the entire script (not just a link/reference to the script) into a local file.
Look forward to your reply.
I think this would be very useful. latest might be asking for trouble though. How about supporting URLs like
For libraries that use semver, this should work pretty well.
The latest was more for explaining my point than suggesting that it was the best solution, @pwnall's does seem much nicer though as it would allow the locking of a major version which could be very handy.
I think it would be good to do things Google style, e.g.
Notice you can have the latest major, minor or specific version. The nice thing about this strategy is it doesn't make assumptions about semantic versioning, e.g.
I'll begin investigating possibilities for achieving this.
That would be my preferred url syntax too.
Thanks @ryankirkman for looking into this.
@jannisg @ryankirkman because we are running a server for the stats now, we could throw an API on there that could handle this situation.
Would add network request so wouldn't be fantastic for serving files on website.
Or we could throw into the build process a script that copies the latest version into a latest.js file next to package.json...
Closing this issue for more information visit #360