Commit 6725ed54 authored by Evan You's avatar Evan You

add preload/prefetch directives

parent 1b078be1
...@@ -8,6 +8,13 @@ ...@@ -8,6 +8,13 @@
<link rel="shortcut icon" sizes="48x48" href="/public/logo-48.png"> <link rel="shortcut icon" sizes="48x48" href="/public/logo-48.png">
<meta name="theme-color" content="#f60"> <meta name="theme-color" content="#f60">
<link rel="manifest" href="/manifest.json"> <link rel="manifest" href="/manifest.json">
<% for (var chunk of webpack.chunks) { %>
<% for (var file of chunk.files) { %>
<% if (file.match(/\.(js|css)$/)) { %>
<link rel="<%= chunk.initial?'preload':'prefetch' %>" href="<%= htmlWebpackPlugin.files.publicPath + file %>" as="<%= file.match(/\.css$/)?'style':'script' %>">
<% } %>
<% } %>
<% } %>
</head> </head>
<body> <body>
<!-- APP --> <!-- APP -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment