index.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  7. <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  8. <meta http-equiv="Pragma" content="no-cache" />
  9. <meta http-equiv="Expires" content="0" />
  10. <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  11. <title><%= htmlWebpackPlugin.options.title %></title>
  12. <style>
  13. .image-loading{
  14. width:100%;
  15. height:100vh;
  16. top: 0;
  17. left: 0;
  18. display: flex;
  19. justify-content: center;
  20. align-items: center;
  21. position: absolute;
  22. background-color: rgba(24, 24, 24, .08);
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
  28. <link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet">
  29. <% } %>
  30. <!--<div class="image-loading"><img src="<%= BASE_URL %>loading.svg" style="width: 100px;height: 100px;" /></div>-->
  31. <noscript>
  32. <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  33. </noscript>
  34. <div id="app"></div>
  35. <!-- built files will be auto injected -->
  36. <!--//下列是css ,script的话注释换一下,仔细看很好理解,config配置是添加一个cdn变量,然后在模板中遍历添加-->
  37. <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
  38. <script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>" crossorigin="anonymous"></script>
  39. <% } %>
  40. </body>
  41. </html>