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
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,9 @@ You can import a template into JS as a compiled [template function](#template-in
26
26
27
27
This plugin is an **advanced successor** to `html-webpack-plugin` and a replacement of the [plugins and loaders](#list-of-plugins).
28
28
29
+
> 📢 Please help promote this plugin on social networks so that developers know about this useful plugin.\
30
+
> Special Thanks to [Andrew Lisowski](https://twitter.com/HipsterSmoothie) for the tooltips in the video [www.youtube.com/@devtoolsfm](https://youtu.be/w4l89214zN4?si=x-eVXN-iLlOE_Gqy&t=3463).
31
+
29
32
<!--
30
33
<table align="center">
31
34
<tr><th>Entry point is HTML</th></tr>
@@ -127,7 +130,7 @@ You can use a relative path or Webpack alias to a source file.
127
130
- Generates the [integrity](#option-integrity) attribute in the `link` and `script` tags.
128
131
- Generates the [favicons](#favicons-bundler-plugin) of different sizes for various platforms.
129
132
- You can create **own plugin** using the [Plugin Hooks](#plugin-hooks-and-callbacks).
130
-
- Over 400[tests](https://github.com/webdiscus/html-bundler-webpack-plugin/tree/master/test).
133
+
- Over 500[tests](https://github.com/webdiscus/html-bundler-webpack-plugin/tree/master/test).
131
134
132
135
See the [full list of features](#features).
133
136
@@ -540,7 +543,7 @@ See [boilerplate](https://github.com/webdiscus/webpack-html-scss-boilerplate)
540
543
- auto processing multiple HTML templates using the [entry path](#option-entry-path)
541
544
-[pass data](#option-entry-advanced) into template from the plugin config
542
545
- dynamically loading template variables using the [data](#loader-option-data) option, change data w/o restarting
543
-
-supports the [integrity](#option-integrity) attribute in the `link` and `script` tags
546
+
-generates the `integrity hashes` and adds the [integrity](#option-integrity) attribute to the `link` and `script` tags
544
547
-[minification](#option-minify) of generated HTML
545
548
- allows extending base functionality using [hooks & callbacks](#plugin-hooks-and-callbacks)
546
549
-[generates favicons](#favicons-bundler-plugin) of different sizes for various platforms and injects them into HTML
The [subresource integrity hash](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) is a cryptographic value of the integrity attribute that used by a browser to verify that the content of an asset has not been manipulated.
2347
2350
If the asset has been manipulated, the browser will never load it.
2348
2351
2349
-
The Bundler Plugin adds the integrity attribute to the `link` and `script` tags when generating HTML.
2352
+
The Bundler Plugin generates the integrity hashes and adds the integrity attribute to the `link` and `script` tags when generating HTML.
2350
2353
2351
2354
> No additional plugins required. This plugin computes integrity hashes itself.
2352
2355
@@ -2384,9 +2387,11 @@ or an array to specify multiple hash functions for compatibility with many brows
2384
2387
>
2385
2388
> When used the `integrity` option:
2386
2389
>
2387
-
> - the [`js.filename`](#option-js) and [`css.filename`](#option-css) options must contain the `contenthash`;
2388
-
> - the [`output.crossOriginLoading`](https://webpack.js.org/configuration/output/#outputcrossoriginloading) Webpack option must be specified;
2389
-
> - the [`optimization.realContentHash`](https://webpack.js.org/configuration/optimization/#optimizationrealcontenthash) Webpack option must be enabled, is enabled by default in production mode only.
2390
+
> - The [`js.filename`](#option-js) and [`css.filename`](#option-css) options must contain the `contenthash`.
2391
+
> - The [`output.crossOriginLoading`](https://webpack.js.org/configuration/output/#outputcrossoriginloading) Webpack option must be specified as `'use-credentials'` or `'anonymous'`.
2392
+
> The bundler plugin adds the `crossorigin` attribute with the value defined in the `crossOriginLoading`.
2393
+
> The `crossorigin` attribute tells the browser to request the script with CORS enabled, which is necessary because the integrity check fails without CORS.
2394
+
> - The [`optimization.realContentHash`](https://webpack.js.org/configuration/optimization/#optimizationrealcontenthash) Webpack option must be enabled, is enabled by default in production mode only.
2390
2395
>
2391
2396
> This requirement is necessary to avoid the case where the browser tries to load a contents of a file from the local cache since the filename has not changed, but the `integrity` value has changed on the server.
2392
2397
> In this case, the browser will not load the file because the `integrity` of the cached file computed by the browser will not match the `integrity` attribute computed on the server.
0 commit comments