You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-4Lines changed: 17 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2495,6 +2495,17 @@ The descriptions of the properties:
2495
2495
e.g. `attributes: { crossorigin:true }`, `attributes: { media:'(max-width: 900px)' }`.\
2496
2496
Defaults `{}`.
2497
2497
2498
+
> [!NOTE]
2499
+
>
2500
+
> The `true` value of a property will be rendered as an attribute w/o a value.
2501
+
>
2502
+
> For example, the `attributes: { crossorigin:true }` will be rendered to:
2503
+
> ```html
2504
+
><link rel="preload"... crossorigin />
2505
+
>```
2506
+
>
2507
+
> Setting the [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) attribute to an empty value, like `crossorigin` or `crossorigin=""`, is the same as `anonymous`.
2508
+
2498
2509
If you define the `attributes` than you can write the `as`, `rel` and `type` properties in the `attributes`.
2499
2510
2500
2511
For example:
@@ -2592,7 +2603,9 @@ preload: [
2592
2603
2593
2604
> ℹ️ **Note**
2594
2605
>
2595
-
> Font preloading requires the `crossorigin` attribute to be set.
2606
+
> Font preloading [requires](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preload#cors-enabled_fetches) the `crossorigin` attribute to be set.\
2607
+
> If the `crossorigin` property is not defined, it will be added for the `font` type automatically.
2608
+
>
2596
2609
> See [font preload](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preload#what_types_of_content_can_be_preloaded).
2597
2610
2598
2611
#### Preload tags order
@@ -5229,7 +5242,7 @@ module.exports = {
5229
5242
preload: [
5230
5243
{
5231
5244
test:/\.(woff2|woff)$/,
5232
-
attributes: { as:'font', crossorigin:true },
5245
+
attributes: { as:'font' },
5233
5246
},
5234
5247
],
5235
5248
}),
@@ -5266,8 +5279,8 @@ The generated HTML contains the preload tag with the font:
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "html-bundler-webpack-plugin",
3
-
"version": "4.12.0",
3
+
"version": "4.12.1",
4
4
"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.",
0 commit comments