html-bundler-webpack-plugin
Advanced tools
Comparing version 4.12.0 to 4.12.1
# Changelog | ||
## 4.12.1 (2025-01-12) | ||
- fix: incorrect output of preload tag if "crossorigin: true", #139 | ||
- fix: if `as=font` is used in preload and the `crossorigin` is not defined, | ||
it will be added automatically, because the `crossorigin` is mandatory for `font` type | ||
## 4.12.0 (2025-01-12) | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "html-bundler-webpack-plugin", | ||
"version": "4.12.0", | ||
"version": "4.12.1", | ||
"description": "Generates complete single-page or multi-page website from source assets. Build-in support for Markdown, Eta, EJS, Handlebars, Nunjucks, Pug. Alternative to html-webpack-plugin.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -123,2 +123,5 @@ const path = require('path'); | ||
// for the `font` type, the `crossorigin` attribute is mandatory, if it is not defined, set to default value | ||
if (as === 'font' && !('crossorigin' in attrs)) attrs.crossorigin = true; | ||
// whether the 'type' property exist regardless of a value; | ||
@@ -183,3 +186,4 @@ // if the property exists and have the undefined value, exclude this attribute in generating preload tag | ||
for (const [key, value] of Object.entries(attrs)) { | ||
if (value != null) tag += ` ${key}="${value}"`; | ||
if (value === true) tag += ` ${key}`; | ||
else if (value != null) tag += ` ${key}="${value}"`; | ||
} | ||
@@ -186,0 +190,0 @@ tag += '>'; |
Sorry, the diff of this file is too big to display
748611
13194
7034