CDN for non build files


#1

Now that RawGit is no longer serving up files, I’m using unpkg for referencing files from GitHub to include in jsfiddles and codepens, for example, OrbitControls.js:

<script type="text/javascript" src="https://unpkg.com/three@0.97.0/examples/js/controls/OrbitControls.js"></script>

This works fine. Any other options out there?


#2

There was also a discussion about that topic at github:

The following site seems to work very well. I have used it in the latest PRs.

https://raw.githack.com/


#3

I’ve used with my fiddles!


#4

In my post
Addon. Produces almost infinite many time-varying geometries with functions
@looeee brought the library to rawgit. I cannot edit the article.

In my collection of examples
http://discourse.threejs.hofk.de/
http://discourse.threejs.hofk.de/XeXamples.html
(just add the old examples from 2017)

there are links to rawgit in the jsfiddles, e.g.
@Mugen87
Endless Forest (2018 Port)
https://jsfiddle.net/ctsqkpgh/?utm_source=website&utm_medium=embed&utm_campaign=ctsqkpgh
There will soon be many broken links there.

Is there a simple solution to avoid this?


#5

Thanks for reporting!

I’ve replaced rawgit with the three.js domain. Links look like this now:

https://threejs.org/build/three.js
https://threejs.org/examples/js/loaders/GLTFLoader.js


#6

That’s what I was afraid of!
Apparently every user has to do this “by hand”.

With
Endless Forest (2018 Port)
now the link to https://jsfiddle.net/ctsqkpgh/6/show is new.

But in my collection remains the old link
https://jsfiddle.net/ctsqkpgh/ with rawgit.com!

Since surely not all links are renewed by the authors, there will be many broken links.


#7

Yeah, this is unfortunate. But when a CDN goes offline, broken links are inevitable :frowning_face:


#8

Links of the form https://threejs.org/build/three.js
are also problematic, because the content changes with the versions.

An older example:


I noticed that there is a problem, when I was looking at the examples from discourse.threejs.org

The solution @prisoner849
https://jsfiddle.net/prisoner849/L7njaghm/ uses threejs.org/build/three.min.js


Therefore I have always tried to use the currently valid version in the examples. In addition the version number in the file name.