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
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,9 @@ var CompressionPlugin = require("compression-webpack-plugin");
7
7
module.exports= {
8
8
plugins: [
9
9
newCompressionPlugin({
10
-
asset:"{file}.gz",
10
+
asset:"[path].gz[query]",
11
11
algorithm:"gzip",
12
-
regExp:/\.js$|\.html$/,
12
+
test:/\.js$|\.html$/,
13
13
threshold:10240,
14
14
minRatio:0.8
15
15
})
@@ -19,9 +19,9 @@ module.exports = {
19
19
20
20
Arguments:
21
21
22
-
*`asset`: The target asset name. `{file}` is replaced with the original asset. Defaults to `"{file}.gz"`.
22
+
*`asset`: The target asset name. `[file]` is replaced with the original asset. `[path]` is replaced with the path of the original asset and `[query]` with the query. Defaults to `"[path].gz[query]"`.
23
23
*`algorithm`: Can be a `function(buf, callback)` or a string. For a string the algorithm is taken from `zlib` (or zopfli for `zopfli`). Defaults to `"gzip"`.
24
-
*`regExp`: All assets matching this RegExp are processed. Defaults to every asset.
24
+
*`test`: All assets matching this RegExp are processed. Defaults to every asset.
25
25
*`threshold`: Only assets bigger than this size are processed. In bytes. Defaults to `0`.
26
26
*`minRatio`: Only assets that compress better that this ratio are processed. Defaults to `0.8`.
0 commit comments