@@ -11,16 +11,20 @@ manipulation.
11
11
12
12
## Features
13
13
14
- - Optional integration with [ html-webpack-plugin] ( https://github.com/ampedandwired/html-webpack-plugin )
15
- - Automatic support for code splitting (integrity for lazy-loaded chunks )
16
- - Compatible with Webpack 1.x, 2.x, 3.x and 4.x
14
+ - Optional integration with [ html-webpack-plugin] ( https://github.com/ampedandwired/html-webpack-plugin ) .
15
+ - Automatic support for dynamic imports (also known as code splitting. )
16
+ - Compatible with all major Webpack versions, up to and including Webpack 5.
17
17
18
18
## Installation
19
19
20
20
``` shell
21
21
npm install webpack-subresource-integrity --save-dev
22
22
```
23
23
24
+ ``` shell
25
+ yarn add --dev webpack-subresource-integrity
26
+ ```
27
+
24
28
### Webpack Configuration Example
25
29
26
30
``` javascript
@@ -81,9 +85,11 @@ template as follows:
81
85
#### Without HtmlWebpackPlugin
82
86
83
87
The correct value for the ` integrity ` attribute can be retrieved from
84
- the ` integrity ` property of Webpack assets. However, that property is
85
- not copied over by Webpack's ` stats ` module so you'll have to access
86
- the "original" asset on the ` compilation ` object. For example:
88
+ the ` integrity ` property of Webpack assets.
89
+
90
+ Note that with Webpack versions before 5, that property is not copied over by
91
+ Webpack's ` stats ` module so you'll have to access the "original" asset on the
92
+ ` compilation ` object. For example:
87
93
88
94
``` javascript
89
95
compiler .plugin (" done" , stats => {
0 commit comments