-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex-esm.html
34 lines (29 loc) · 1.05 KB
/
index-esm.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html>
<head></head>
<body>
<button onclick="AppModule.renderDateString()">Show current year</button>
<!-- Renders to this container -->
<p id="date-string-container"></p>
<!-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#importing_modules_using_import_maps -->
<script type="importmap">
{
"imports": {
"module-demo/date-utils": "./build/esm/date-utils.js",
"module-demo/smiley": "./build/esm/smiley.js",
"lodash": ".//node_modules/lodash-es/lodash.js"
}
}
</script>
<!-- Defining an importmap entry for all files in "module-demo/" doesn't work because of missing .js suffix in imports -->
<!--<script type="importmap">-->
<!-- {-->
<!-- "imports": {-->
<!-- "module-demo/": "./build/esm/",-->
<!-- "lodash": "./node_modules/lodash-es/lodash.js"-->
<!-- }-->
<!-- }-->
<!--</script>-->
<!-- If you omit type="module", browser complains: "Uncaught SyntaxError: Cannot use import statement outside a module" -->
<script type="module" src="build/esm/main.js"></script>
</body>
</html>