Skip to content

Commit a2955f0

Browse files
authored
Examples: Use import maps polyfill. (#23163)
1 parent bd23028 commit a2955f0

11 files changed

+20
-152
lines changed

examples/jsm/capabilities/ImportMaps.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

examples/webgpu_compute.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> WebGPU - Compute
1313
</div>
1414

15+
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
16+
1517
<script type="importmap">
1618
{
1719
"imports": {
@@ -20,18 +22,6 @@
2022
}
2123
</script>
2224

23-
<script type="module">
24-
25-
import ImportMaps from './jsm/capabilities/ImportMaps.js';
26-
27-
if ( ImportMaps.isAvailable() === false ) {
28-
29-
document.body.appendChild( ImportMaps.getErrorMessage() );
30-
31-
}
32-
33-
</script>
34-
3525
<script type="module">
3626

3727
import * as THREE from 'three';

examples/webgpu_instance_uniform.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> - WebGPU - Instance Uniform
1414
</div>
1515

16+
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
17+
1618
<script type="importmap">
1719
{
1820
"imports": {
@@ -21,18 +23,6 @@
2123
}
2224
</script>
2325

24-
<script type="module">
25-
26-
import ImportMaps from './jsm/capabilities/ImportMaps.js';
27-
28-
if ( ImportMaps.isAvailable() === false ) {
29-
30-
document.body.appendChild( ImportMaps.getErrorMessage() );
31-
32-
}
33-
34-
</script>
35-
3626
<script type="module">
3727

3828
import * as THREE from 'three';

examples/webgpu_lights_custom.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> WebGPU - Custom Lighting Model
1313
</div>
1414

15+
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
16+
1517
<script type="importmap">
1618
{
1719
"imports": {
@@ -20,18 +22,6 @@
2022
}
2123
</script>
2224

23-
<script type="module">
24-
25-
import ImportMaps from './jsm/capabilities/ImportMaps.js';
26-
27-
if ( ImportMaps.isAvailable() === false ) {
28-
29-
document.body.appendChild( ImportMaps.getErrorMessage() );
30-
31-
}
32-
33-
</script>
34-
3525
<script type="module">
3626

3727
import * as THREE from 'three';

examples/webgpu_lights_selective.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<b style="color:red">Left: Red lights</b> - <b>Center: All lights</b> - <b style="color:blue">Right: blue light</b>
1616
</div>
1717

18+
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
19+
1820
<script type="importmap">
1921
{
2022
"imports": {
@@ -23,18 +25,6 @@
2325
}
2426
</script>
2527

26-
<script type="module">
27-
28-
import ImportMaps from './jsm/capabilities/ImportMaps.js';
29-
30-
if ( ImportMaps.isAvailable() === false ) {
31-
32-
document.body.appendChild( ImportMaps.getErrorMessage() );
33-
34-
}
35-
36-
</script>
37-
3828
<script type="module">
3929

4030
import * as THREE from 'three';

examples/webgpu_materials.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> WebGPU - Materials
1414
</div>
1515

16+
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
17+
1618
<script type="importmap">
1719
{
1820
"imports": {
@@ -21,18 +23,6 @@
2123
}
2224
</script>
2325

24-
<script type="module">
25-
26-
import ImportMaps from './jsm/capabilities/ImportMaps.js';
27-
28-
if ( ImportMaps.isAvailable() === false ) {
29-
30-
document.body.appendChild( ImportMaps.getErrorMessage() );
31-
32-
}
33-
34-
</script>
35-
3626
<script type="module">
3727

3828
import * as THREE from 'three';

examples/webgpu_nodes_playground.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> - WebGPU - Node Editor ( Playground version )<br />
4040
</div>
4141

42+
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
43+
4244
<script type="importmap">
4345
{
4446
"imports": {
@@ -47,18 +49,6 @@
4749
}
4850
</script>
4951

50-
<script type="module">
51-
52-
import ImportMaps from './jsm/capabilities/ImportMaps.js';
53-
54-
if ( ImportMaps.isAvailable() === false ) {
55-
56-
document.body.appendChild( ImportMaps.getErrorMessage() );
57-
58-
}
59-
60-
</script>
61-
6252
<script type="module">
6353

6454
import * as THREE from 'three';

examples/webgpu_rtt.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> WebGPU - RTT
1313
</div>
1414

15+
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
16+
1517
<script type="importmap">
1618
{
1719
"imports": {
@@ -20,18 +22,6 @@
2022
}
2123
</script>
2224

23-
<script type="module">
24-
25-
import ImportMaps from './jsm/capabilities/ImportMaps.js';
26-
27-
if ( ImportMaps.isAvailable() === false ) {
28-
29-
document.body.appendChild( ImportMaps.getErrorMessage() );
30-
31-
}
32-
33-
</script>
34-
3525
<script type="module">
3626

3727
import * as THREE from 'three';

examples/webgpu_sandbox.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> WebGPU - Sandbox
1313
</div>
1414

15+
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
16+
1517
<script type="importmap">
1618
{
1719
"imports": {
@@ -20,18 +22,6 @@
2022
}
2123
</script>
2224

23-
<script type="module">
24-
25-
import ImportMaps from './jsm/capabilities/ImportMaps.js';
26-
27-
if ( ImportMaps.isAvailable() === false ) {
28-
29-
document.body.appendChild( ImportMaps.getErrorMessage() );
30-
31-
}
32-
33-
</script>
34-
3525
<script type="module">
3626

3727
import * as THREE from 'three';

examples/webgpu_skinning.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> WebGPU - Skinning
1515
</div>
1616

17+
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
18+
1719
<script type="importmap">
1820
{
1921
"imports": {
@@ -22,18 +24,6 @@
2224
}
2325
</script>
2426

25-
<script type="module">
26-
27-
import ImportMaps from './jsm/capabilities/ImportMaps.js';
28-
29-
if ( ImportMaps.isAvailable() === false ) {
30-
31-
document.body.appendChild( ImportMaps.getErrorMessage() );
32-
33-
}
34-
35-
</script>
36-
3727
<script type="module">
3828

3929
import * as THREE from 'three';

0 commit comments

Comments
 (0)