Add option to make async leave a rel="preload" in the header and append a <link rel="stylesheet"> to the end of body.

This commit is contained in:
Jason Miller
2018-04-05 12:41:19 -04:00
parent 387f4cf9a3
commit 919a259b0a
2 changed files with 14 additions and 4 deletions

View File

@@ -177,8 +177,10 @@ module.exports = function(_, env) {
isProd && new PreloadWebpackPlugin(),
isProd && new CrittersPlugin({
// convert critical'd <link rel="stylesheet"> to <link rel="preload" as="style" onload="this.rel='stylesheet'">
async: true
// convert critical'd <link rel="stylesheet"> to <link rel="preload" as="style">:
async: true,
// copy original <link rel="stylesheet"> to the end of <body>:
preload: true
}),
// Inline constants during build, so they can be folded by UglifyJS.