Skip to content

Commit bf42f36

Browse files
committed
use importMap to import both melonJS and the Tiled inflate plugin
1 parent e02777b commit bf42f36

File tree

3 files changed

+13
-7198
lines changed

3 files changed

+13
-7198
lines changed

tiled_example_loader/index.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,19 @@
3333

3434
<div id="screen" style="float: inherit;">
3535
</div>
36-
36+
<!-- Since import maps are not yet supported by all browsers, its is necessary to add the polyfill es-module-shims.js -->
37+
<script async src="https://unpkg.com/es-module-shims@1.7.3/dist/es-module-shims.js"></script>
38+
<script type="importmap">
39+
{
40+
"imports": {
41+
"melonjs": "https://cdn.jsdelivr.net/npm/melonjs/+esm",
42+
"tiled-inflate-plugin" : "https://cdn.jsdelivr.net/npm/@melonjs/tiled-inflate-plugin/dist/@melonjs/tiled-inflate-plugin.min.js"
43+
}
44+
}
45+
</script>
3746
<!-- Bootstrap -->
3847
<script type="module">
39-
import { device } from 'https://esm.run/melonjs';
48+
import { device } from 'melonjs';
4049
import onload from './js/index.js';
4150

4251
device.onReady(function onReady() {

tiled_example_loader/js/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import resources from './resources.js';
2-
import * as me from 'https://esm.run/melonjs';
3-
import { TiledInflatePlugin } from './tiled-inflate-plugin.js';
2+
import * as me from 'melonjs';
3+
import { TiledInflatePlugin } from 'tiled-inflate-plugin';
44

55
/**
66
*

0 commit comments

Comments
 (0)