metalsmith-inline-critical-css
Advanced tools
Comparing version 1.0.0-beta.3 to 1.0.0-beta.4
@@ -125,3 +125,2 @@ "use strict"; | ||
const linkStylesheet = $link.toString(); | ||
const noscriptFallback = `<noscript>${linkStylesheet}</noscript>`; | ||
/* Change the link tag and add the relevant markup to the page. | ||
@@ -131,3 +130,2 @@ * <link rel="stylesheet"...> -> | ||
* <link rel="stylesheet" href="/path/to/mystylesheet.css" media="print" onload="this.media='all'"> | ||
* <noscript><link rel="stylesheet" ...></noscript> | ||
*/ | ||
@@ -139,4 +137,3 @@ $link | ||
}) | ||
.before(criticalStyleTag) | ||
.after(noscriptFallback); | ||
.before(criticalStyleTag); | ||
const newHtml = $.html(); | ||
@@ -143,0 +140,0 @@ return newHtml; |
@@ -60,3 +60,3 @@ "use strict"; | ||
} | ||
</style><link rel="stylesheet" href="index.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="index.css"></noscript> | ||
</style><link rel="stylesheet" href="index.css" media="print" onload="this.media='all'"> | ||
</head> | ||
@@ -63,0 +63,0 @@ <body> |
{ | ||
"name": "metalsmith-inline-critical-css", | ||
"version": "1.0.0-beta.3", | ||
"version": "1.0.0-beta.4", | ||
"description": "Metalsmith plugin to inspect HTML files, inline used selectors from specified CSS, and load the rest asynchronously.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
27101
517