-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.min.html
30 lines (30 loc) · 953 Bytes
/
index.min.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
<!DOCTYPE html>
<html>
<head>
<title>ES6 and Legacy bundle loading</title>
</head>
<body>
Hi
<script>
// populate this on the server or via webpack
window.__APP_CHUNKS__ = {
es: [
'/main.js',
'/first.chunk.js',
'/second.chunk.js'
],
legacy: [
'/main.legacy.js',
'/first.legacy.chunk.js',
'/second.legacy.chunk.js'
]
};
// load correct bundles
var s=document.createElement('script');var c=[];if(s.noModule===false)
{window.__APP_CHUNKS__.es.forEach(function(h){var n=document.createElement('script');
n.setAttribute('src', h);c.push(n);});}else{window.__APP_CHUNKS__.legacy.forEach(
function(b){var g=document.createElement('script');g.setAttribute('src', b);c.push(g);
});};c.forEach(function(v){v.setAttribute('defer',true);document.body.appendChild(v);});
</script>
</body>
</html>