@@ -29,7 +29,7 @@ Then add the plugin to your `webpack` config. For example:
2929** webpack.config.js**
3030
3131``` js
32- const CompressionPlugin = require (' compression-webpack-plugin' );
32+ const CompressionPlugin = require (" compression-webpack-plugin" );
3333
3434module .exports = {
3535 plugins: [new CompressionPlugin ()],
@@ -129,7 +129,7 @@ The algorithm is taken from [zlib](https://nodejs.org/api/zlib.html).
129129module .exports = {
130130 plugins: [
131131 new CompressionPlugin ({
132- algorithm: ' gzip' ,
132+ algorithm: " gzip" ,
133133 }),
134134 ],
135135};
@@ -259,7 +259,7 @@ For example we have `assets/images/image.png?foo=bar#hash`:
259259module .exports = {
260260 plugins: [
261261 new CompressionPlugin ({
262- filename: ' [path][base].gz' ,
262+ filename: " [path][base].gz" ,
263263 }),
264264 ],
265265};
@@ -277,10 +277,10 @@ module.exports = {
277277 // The `pathData` argument contains all placeholders - `path`/`name`/`ext`/etc
278278 // Available properties described above, for the `String` notation
279279 if (/ \. svg$ / .test (pathData .file )) {
280- return ' assets/svg/[path][base].gz' ;
280+ return " assets/svg/[path][base].gz" ;
281281 }
282282
283- return ' assets/js/[path][base].gz' ;
283+ return " assets/js/[path][base].gz" ;
284284 },
285285 }),
286286 ],
@@ -355,7 +355,7 @@ Enable file caching and set path to cache directory.
355355module .exports = {
356356 plugins: [
357357 new CompressionPlugin ({
358- cache: ' path/to/cache' ,
358+ cache: " path/to/cache" ,
359359 }),
360360 ],
361361};
@@ -378,7 +378,7 @@ $ npm install @gfx/zopfli --save-dev
378378** webpack.config.js**
379379
380380``` js
381- const zopfli = require (' @gfx/zopfli' );
381+ const zopfli = require (" @gfx/zopfli" );
382382
383383module .exports = {
384384 plugins: [
@@ -405,13 +405,13 @@ We can take advantage of this built-in support for Brotli in Node 10.16.0 and la
405405** webpack.config.js**
406406
407407``` js
408- const zlib = require (' zlib' );
408+ const zlib = require (" zlib" );
409409
410410module .exports = {
411411 plugins: [
412412 new CompressionPlugin ({
413- filename: ' [path][base].br' ,
414- algorithm: ' brotliCompress' ,
413+ filename: " [path][base].br" ,
414+ algorithm: " brotliCompress" ,
415415 test: / \. (js| css| html| svg)$ / ,
416416 compressionOptions: {
417417 params: {
@@ -434,20 +434,20 @@ You can find all Brotli’s options in [the relevant part of the zlib module doc
434434** webpack.config.js**
435435
436436``` js
437- const zlib = require (' zlib' );
437+ const zlib = require (" zlib" );
438438
439439module .exports = {
440440 plugins: [
441441 new CompressionPlugin ({
442- filename: ' [path][base].gz' ,
443- algorithm: ' gzip' ,
442+ filename: " [path][base].gz" ,
443+ algorithm: " gzip" ,
444444 test: / \. js$ | \. css$ | \. html$ / ,
445445 threshold: 10240 ,
446446 minRatio: 0.8 ,
447447 }),
448448 new CompressionPlugin ({
449- filename: ' [path][base].br' ,
450- algorithm: ' brotliCompress' ,
449+ filename: " [path][base].br" ,
450+ algorithm: " brotliCompress" ,
451451 test: / \. (js| css| html| svg)$ / ,
452452 compressionOptions: {
453453 params: {
0 commit comments