-
Notifications
You must be signed in to change notification settings - Fork 29
/
index.html
44 lines (38 loc) · 1.12 KB
/
index.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
35
36
37
38
39
40
41
42
43
44
<!doctype html>
<html>
<head lang='en'>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width'>
<link rel='icon' type='image/png' href='/favicon.png'>
<title>Rollup code-splitting demo</title>
<link rel='stylesheet' href='styles.css'>
</head>
<body>
<h1>Rollup code-splitting demo</h1>
<p><a href='https://github.com/rollup/rollup-starter-code-splitting'>See the source code on GitHub</a></p>
<div id='a'>
<div data-used-by='a'></div>
<div data-used-by='both'></div>
</div>
<div id='b'>
<div data-used-by='b'></div>
<div data-used-by='both'></div>
</div>
<script>
import("/module/main-a.js");
import("/module/main-b.js");
window.supportsDynamicImport = true;
</script>
<script>
if (!window.supportsDynamicImport) {
const systemJsLoaderTag = document.createElement('script');
systemJsLoaderTag.src = 'https://unpkg.com/systemjs@2.0.0/dist/s.min.js';
systemJsLoaderTag.addEventListener('load', function () {
System.import('./nomodule/main-a.js');
System.import('./nomodule/main-b.js');
});
document.head.appendChild(systemJsLoaderTag);
}
</script>
</body>
</html>