This repository was archived by the owner on Apr 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtemplate.ejs
More file actions
35 lines (32 loc) · 1.37 KB
/
template.ejs
File metadata and controls
35 lines (32 loc) · 1.37 KB
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
<!DOCTYPE html>
<html>
<head>
<title><%= htmlWebpackPlugin.options.title %></title>
<% if (Array.isArray(htmlWebpackPlugin.options.meta)) { %>
<% for (item of htmlWebpackPlugin.options.meta) { %>
<meta<% for (key in item) { %> <%= key %>="<%= item[key] %>"<% } %>>
<% } %>
<% } %>
<% for (key in htmlWebpackPlugin.files.css) { %>
<link href="<%= htmlWebpackPlugin.files.css[key] %>" rel="stylesheet" media="nope!" onload="this.media='all'">
<% } %>
</head>
<body>
<script type="module">
<% for (key in htmlWebpackPlugin.options.modernScripts) { %>
var script<%= [key] %> = document.createElement('script');
script<%= [key] %>.type = 'text/javascript';
script<%= [key] %>.src = '<%= htmlWebpackPlugin.options.modernScripts[key] %>';
document.body.appendChild(script<%= [key] %>);
<% } %>
</script>
<script nomodule>
<% for (key in htmlWebpackPlugin.options.legacyScripts) { %>
var script<%= [key] %> = document.createElement('script');
script<%= [key] %>.type = 'text/javascript';
script<%= [key] %>.src = '<%= htmlWebpackPlugin.options.legacyScripts[key] %>';
document.body.appendChild(script<%= [key] %>);
<% } %>
</script>
</body>
</html>