-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.html
113 lines (113 loc) · 4.04 KB
/
template.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><%= htmlWebpackPlugin.options.title %></title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/assets/icons/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/assets/icons/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/assets/icons/favicon-16x16.png"
/>
<meta
name="description"
content="Hassan Bazzi is an engineering leader with 15+ years of experience. Hassan has built products in a wide variety of spectrums ranging from entertainment to finance."
/>
<link
rel="manifest"
href="<%= htmlWebpackPlugin.files.publicPath %>manifest.json"
/>
<link rel="preconnect" crossorigin href="https://google.com" />
<link rel="preconnect" crossorigin href="https://www.gstatic.com" />
<link rel="preconnect" crossorigin href="https://fonts.gstatic.com" />
<% if (htmlWebpackPlugin.options.manifest.theme_color) { %>
<meta
name="theme-color"
content="<%= htmlWebpackPlugin.options.manifest.theme_color %>"
/>
<% } %> <% const loadManifest =
htmlWebpackPlugin.options.createLoadManifest(compilation.assets,
webpack.namedChunkGroups);%> <% const filesRegexp =
htmlWebpackPlugin.options.inlineCss ? /\.(chunk\.\w{5}\.css|js)$/ :
/\.(css|js)$/;%> <% for (const file in
loadManifest[htmlWebpackPlugin.options.url]) { %> <% if
(htmlWebpackPlugin.options.preload && file && file.match(filesRegexp)) { %>
<% /* crossorigin for main bundle as that is loaded from `<script
type=module` tag, other lazy loaded bundles are from webpack so its not
needed */ %> <link rel="preload" href="<%=
htmlWebpackPlugin.files.publicPath + file %>" as="<%=
file.match(/\.css$/)?'style':'script' %>" <%=
file.match(/bundle\.\w{5}\.esm\.js$/)?'crossorigin="anonymous"':'' %>> <% }
%> <% } %>
</head>
<body>
<%= htmlWebpackPlugin.options.ssr() %> <% if (webpack.assets.filter(entry =>
entry.name.match(/bundle(\.\w{5})?.esm.js$/)).length > 0) { %> <% /* Fix for
safari < 11 nomodule bug. TODO: Do the following only for safari. */ %>
<script>
!(function() {
var e = document,
t = e.createElement("script");
if (!("noModule" in t) && "onbeforeload" in t) {
var n = !1;
e.addEventListener(
"beforeload",
function(e) {
if (e.target === t) n = !0;
else if (!e.target.hasAttribute("nomodule") || !n) return;
e.preventDefault();
},
!0
),
(t.type = "module"),
(t.src = "."),
e.head.appendChild(t),
t.remove();
}
})();
</script>
<script
crossorigin="anonymous"
src="<%= htmlWebpackPlugin.files.publicPath %><%= webpack.assets.filter(entry => entry.name.match(/bundle(\.\w{5})?.esm.js$/))[0].name %>"
type="module"
></script>
<% /*Fetch and Promise polyfills are not needed for browsers that support
type=module Please re-evaluate below line if adding more polyfills.*/ %>
<script nomodule>
window.fetch ||
document.write(
'<script src="<%= htmlWebpackPlugin.files.chunks["polyfills"].entry %>"><\/script>'
);
</script>
<script
nomodule
defer
src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"
></script>
<% } else { %>
<script <%="htmlWebpackPlugin.options.scriptLoading" %>
src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>">
</script>
<script>
window.fetch ||
document.write(
'<script src="<%= htmlWebpackPlugin.files.chunks["polyfills"].entry %>"><\/script>'
);
</script>
<% } %>
</body>
</html>