Skip to content

Commit

Permalink
chore: change cdn from unpkg to jsDelivr
Browse files Browse the repository at this point in the history
Also update README to recommend jsDelivr

Following the Three.js side change.
See: mrdoob/three.js#28006

es-module-shims for import map is also no longer used in Three.js examples.
See: mrdoob/three.js#26836
  • Loading branch information
0b5vr committed Mar 27, 2024
1 parent 95aae20 commit 4de75c1
Show file tree
Hide file tree
Showing 36 changed files with 102 additions and 202 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,20 @@ You will need:

- [Three.js build](https://github.com/mrdoob/three.js/blob/master/build/three.js)
- [GLTFLoader](https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/GLTFLoader.js)
- [A build of @pixiv/three-vrm](https://unpkg.com/browse/@pixiv/three-vrm/lib/)
- [A build of @pixiv/three-vrm](https://www.jsdelivr.com/package/npm/@pixiv/three-vrm?tab=files&path=lib)
- `.module` ones are ESM, otherwise it's UMD and injects its modules into global `THREE`
- `.min` ones are minified (for production), otherwise it's not minified and it comes with source maps

You can import all of them via CDN. See the example below.

Code like this:

```html
<!-- About import maps, see the Three.js official docs: -->
<!-- https://threejs.org/docs/#manual/en/introduction/Installation -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm": "three-vrm.module.js"
}
}
Expand Down
10 changes: 3 additions & 7 deletions packages/three-vrm-animation/examples/dnd.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@
</head>

<body>
<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"@pixiv/three-vrm": "https://unpkg.com/@pixiv/[email protected]/lib/three-vrm.module.js",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm": "https://cdn.jsdelivr.net/npm/@pixiv/[email protected]/lib/three-vrm.module.js",
"@pixiv/three-vrm-animation": "../lib/three-vrm-animation.module.js"
}
}
Expand Down
10 changes: 3 additions & 7 deletions packages/three-vrm-animation/examples/loader-plugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@
</head>

<body>
<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"@pixiv/three-vrm": "https://unpkg.com/@pixiv/[email protected]/lib/three-vrm.module.js",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm": "https://cdn.jsdelivr.net/npm/@pixiv/[email protected]/lib/three-vrm.module.js",
"@pixiv/three-vrm-animation": "../lib/three-vrm-animation.module.js"
}
}
Expand Down
8 changes: 2 additions & 6 deletions packages/three-vrm-core/examples/expressions.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@
</head>

<body>
<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-core": "../lib/three-vrm-core.module.js"
}
}
Expand Down
8 changes: 2 additions & 6 deletions packages/three-vrm-core/examples/firstPerson.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@
<body>
<span id="info"></span>

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-core": "../lib/three-vrm-core.module.js"
}
}
Expand Down
8 changes: 2 additions & 6 deletions packages/three-vrm-core/examples/humanoid.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@
</head>

<body>
<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-core": "../lib/three-vrm-core.module.js"
}
}
Expand Down
10 changes: 3 additions & 7 deletions packages/three-vrm-core/examples/humanoidAnimation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@
drag and drop <a href="https://www.mixamo.com/" target="_blank" rel="noopener noreferrer">mixamo</a> animation (.fbx)<br />
</div>

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"fflate": "https://unpkg.com/[email protected]/esm/browser.js",
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"fflate": "https://cdn.jsdelivr.net/npm/[email protected]/esm/browser.js",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-core": "../../lib/three-vrm-core.module.js"
}
}
Expand Down
8 changes: 2 additions & 6 deletions packages/three-vrm-core/examples/lookAt.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@
<body>
<span id="info"></span>

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-core": "../lib/three-vrm-core.module.js"
}
}
Expand Down
8 changes: 2 additions & 6 deletions packages/three-vrm-core/examples/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,11 @@
<span id="meta"></span>
<img id="thumbnail" alt="thumbnail" />

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-core": "../lib/three-vrm-core.module.js"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@
</head>

<body>
<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-materials-hdr-emissive-multiplier": "../lib/three-vrm-materials-hdr-emissive-multiplier.module.js"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
</head>

<body>
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-materials-mtoon": "../lib/three-vrm-materials-mtoon.module.js"
}
}
Expand Down
8 changes: 2 additions & 6 deletions packages/three-vrm-materials-mtoon/examples/feature-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@
</head>

<body>
<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-materials-mtoon": "../lib/three-vrm-materials-mtoon.module.js"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@
</head>

<body>
<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-materials-mtoon": "../lib/three-vrm-materials-mtoon.module.js"
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/three-vrm-node-constraint/examples/aim.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
</head>

<body>
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"tweakpane": "https://unpkg.com/[email protected]",
"tweakpane-plugin-rotation": "https://unpkg.com/@0b5vr/[email protected]",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"tweakpane": "https://cdn.jsdelivr.net/npm/[email protected]",
"tweakpane-plugin-rotation": "https://cdn.jsdelivr.net/npm/@0b5vr/[email protected]",
"@pixiv/three-vrm-node-constraint": "../lib/three-vrm-node-constraint.module.js"
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/three-vrm-node-constraint/examples/importer.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
</head>

<body>
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"tweakpane": "https://unpkg.com/[email protected]",
"tweakpane-plugin-rotation": "https://unpkg.com/@0b5vr/[email protected]",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"tweakpane": "https://cdn.jsdelivr.net/npm/[email protected]",
"tweakpane-plugin-rotation": "https://cdn.jsdelivr.net/npm/@0b5vr/[email protected]",
"@pixiv/three-vrm-node-constraint": "../lib/three-vrm-node-constraint.module.js"
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/three-vrm-node-constraint/examples/roll.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
</head>

<body>
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"tweakpane": "https://unpkg.com/[email protected]",
"tweakpane-plugin-rotation": "https://unpkg.com/@0b5vr/[email protected]",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"tweakpane": "https://cdn.jsdelivr.net/npm/[email protected]",
"tweakpane-plugin-rotation": "https://cdn.jsdelivr.net/npm/@0b5vr/[email protected]",
"@pixiv/three-vrm-node-constraint": "../lib/three-vrm-node-constraint.module.js"
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/three-vrm-node-constraint/examples/rotation.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
</head>

<body>
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"tweakpane": "https://unpkg.com/[email protected]",
"tweakpane-plugin-rotation": "https://unpkg.com/@0b5vr/[email protected]",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"tweakpane": "https://cdn.jsdelivr.net/npm/[email protected]",
"tweakpane-plugin-rotation": "https://cdn.jsdelivr.net/npm/@0b5vr/[email protected]",
"@pixiv/three-vrm-node-constraint": "../lib/three-vrm-node-constraint.module.js"
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/three-vrm-node-constraint/examples/upper-arm.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
</head>

<body>
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"tweakpane": "https://unpkg.com/[email protected]",
"tweakpane-plugin-rotation": "https://unpkg.com/@0b5vr/[email protected]",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"tweakpane": "https://cdn.jsdelivr.net/npm/[email protected]",
"tweakpane-plugin-rotation": "https://cdn.jsdelivr.net/npm/@0b5vr/[email protected]",
"@pixiv/three-vrm-node-constraint": "../lib/three-vrm-node-constraint.module.js"
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/three-vrm-springbone/examples/collider.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
</head>

<body>
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-springbone": "../lib/three-vrm-springbone.module.js"
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/three-vrm-springbone/examples/loader-plugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
</head>

<body>
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-springbone": "../lib/three-vrm-springbone.module.js"
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/three-vrm-springbone/examples/multiple.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
</head>

<body>
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"@pixiv/three-vrm-springbone": "../lib/three-vrm-springbone.module.js"
}
}
Expand Down
Loading

0 comments on commit 4de75c1

Please sign in to comment.