@@ -139,98 +139,6 @@ module.exports = {
139139};
140140```
141141
142- ### ` cache `
143-
144- > ⚠ Ignored in webpack 5! Please use https://webpack.js.org/configuration/other-options/#cache .
145-
146- Type: ` Boolean|String `
147- Default: ` true `
148-
149- Enable file caching.
150- Default path to cache directory: ` node_modules/.cache/html-minimizer-webpack-plugin ` .
151-
152- > ℹ️ If you use your own ` minify ` function please read the ` minify ` section for cache invalidation correctly.
153-
154- #### ` Boolean `
155-
156- Enable/disable file caching.
157-
158- ** webpack.config.js**
159-
160- ``` js
161- module .exports = {
162- optimization: {
163- minimize: true ,
164- minimizer: [
165- new HtmlMinimizerPlugin ({
166- cache: true ,
167- }),
168- ],
169- },
170- };
171- ```
172-
173- #### ` String `
174-
175- Enable file caching and set path to cache directory.
176-
177- ** webpack.config.js**
178-
179- ``` js
180- module .exports = {
181- optimization: {
182- minimize: true ,
183- minimizer: [
184- new HtmlMinimizerPlugin ({
185- cache: ' path/to/cache' ,
186- }),
187- ],
188- },
189- };
190- ```
191-
192- ### ` cacheKeys `
193-
194- > ⚠ Ignored in webpack 5! Please use https://webpack.js.org/configuration/other-options/#cache .
195-
196- Type: ` Function<(defaultCacheKeys, file) -> Object> `
197- Default: ` defaultCacheKeys => defaultCacheKeys `
198-
199- Allows you to override default cache keys.
200-
201- Default cache keys:
202-
203- ``` js
204- ({
205- htmlMinimizer: require (' html-minifier-terser/package.json' ).version , // html-minifier-terser version
206- ' html-minimizer-webpack-plugin' : require (' ../package.json' ).version , // plugin version
207- ' html-minimizer-webpack-plugin-options' : this .options , // plugin options
208- nodeVersion: process .version , // Node.js version
209- assetName: file, // asset path
210- contentHash: crypto .createHash (' md4' ).update (input).digest (' hex' ), // source file hash
211- });
212- ```
213-
214- ** webpack.config.js**
215-
216- ``` js
217- module .exports = {
218- optimization: {
219- minimize: true ,
220- minimizer: [
221- new HtmlMinimizerPlugin ({
222- cache: true ,
223- cacheKeys : (defaultCacheKeys , file ) => {
224- defaultCacheKeys .myCacheKey = ' myCacheKeyValue' ;
225-
226- return defaultCacheKeys;
227- },
228- }),
229- ],
230- },
231- };
232- ```
233-
234142### ` parallel `
235143
236144Type: ` Boolean|Number `
0 commit comments