|
2 | 2 | <html lang="en">
|
3 | 3 | <head>
|
4 | 4 | <meta charset="utf-8">
|
5 |
| - <title><%= htmlWebpackPlugin.options.title %></title> |
| 5 | + <title><% preact.title %></title> |
6 | 6 | <meta name="viewport" content="width=device-width,initial-scale=1">
|
7 | 7 | <meta name="mobile-web-app-capable" content="yes">
|
8 | 8 | <meta name="apple-mobile-web-app-capable" content="yes">
|
9 |
| - <link rel="manifest" href="<%= htmlWebpackPlugin.files.publicPath %>manifest.json"> |
10 |
| - <% if (htmlWebpackPlugin.options.manifest.theme_color) { %> |
11 |
| - <meta name="theme-color" content="<%= htmlWebpackPlugin.options.manifest.theme_color %>"> |
| 9 | + <meta property="og:title" content="<%= htmlWebpackPlugin.options.title %>" /> |
| 10 | + <% if(htmlWebpackPlugin.options.seo && 'cover' in htmlWebpackPlugin.options.seo) {%> |
| 11 | + <meta property="og:image" content="<%= htmlWebpackPlugin.options.seo.cover %>" /> |
| 12 | + <meta name="twitter:image:src" content="<%= htmlWebpackPlugin.options.seo.cover %>"> |
12 | 13 | <% } %>
|
13 |
| - <% const loadManifest = htmlWebpackPlugin.options.createLoadManifest(compilation.assets, webpack.namedChunkGroups);%> |
14 |
| - <% const filesRegexp = htmlWebpackPlugin.options.inlineCss ? /\.(chunk\.\w{5}\.css|js)$/ : /\.(css|js)$/;%> |
15 |
| - <% for (const file in loadManifest[htmlWebpackPlugin.options.url]) { %> |
16 |
| - <% if (htmlWebpackPlugin.options.preload && file && file.match(filesRegexp)) { %> |
17 |
| - <% /* crossorigin for main bundle as that is loaded from `<script type=module` tag, other lazy loaded bundles are from webpack so its not needed */ %> |
18 |
| - <link rel="preload" href="<%= htmlWebpackPlugin.files.publicPath + file %>" as="<%= file.match(/\.css$/)?'style':'script' %>" <%= file.match(/bundle\.\w{5}\.esm\.js$/)?'crossorigin="anonymous"':'' %>> |
19 |
| - <% } %> |
| 14 | + <% if(htmlWebpackPlugin.options.seo && 'subtitle' in htmlWebpackPlugin.options.seo) {%> |
| 15 | + <meta property="og:description" content="<%= htmlWebpackPlugin.options.seo.subtitle %>" /> |
| 16 | + <meta property="twitter:description" content="<%= htmlWebpackPlugin.options.seo.subtitle %>" /> |
| 17 | + <meta property="description" content="<%= htmlWebpackPlugin.options.seo.subtitle %>" /> |
20 | 18 | <% } %>
|
| 19 | + <% preact.headEnd %> |
21 | 20 | </head>
|
22 | 21 | <body>
|
23 |
| - <%= htmlWebpackPlugin.options.ssr() %> |
24 |
| - <script type="__PREACT_CLI_DATA__"> |
25 |
| - <%= JSON.stringify(htmlWebpackPlugin.options.CLI_DATA) %> |
26 |
| - </script> |
27 |
| - <% if (webpack.assets.filter(entry => entry.name.match(/bundle(\.\w{5})?.esm.js$/)).length > 0) { %> |
28 |
| - <% /* Fix for safari < 11 nomodule bug. TODO: Do the following only for safari. */ %> |
29 |
| - <script nomodule>!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> |
30 |
| - <script crossorigin="anonymous" src="<%= htmlWebpackPlugin.files.publicPath %><%= webpack.assets.filter(entry => entry.name.match(/bundle(\.\w{5})?.esm.js$/))[0].name %>" type="module"></script> |
31 |
| - <% |
32 |
| - /*Fetch and Promise polyfills are not needed for browsers that support type=module |
33 |
| - Please re-evaluate below line if adding more polyfills.*/ |
34 |
| - %> |
35 |
| - <script nomodule src="<%= htmlWebpackPlugin.files.chunks["polyfills"].entry %>"></script> |
36 |
| - <script nomodule defer src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"></script> |
37 |
| - <% } else { %> |
38 |
| - <script <%= htmlWebpackPlugin.options.scriptLoading %> src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"></script> |
39 |
| - <script nomodule src="<%= htmlWebpackPlugin.files.chunks["polyfills"].entry %>"></script> |
40 |
| - <% } %> |
| 22 | + <% preact.bodyEnd %> |
41 | 23 | </body>
|
42 | 24 | </html>
|
0 commit comments