🤖 Merge PR #49467 update(compression-webpack-plugin): deleteOriginalAssets by @peterblazejewicz

Update type for `deleteOriginalAssets` option:

https://github.com/webpack-contrib/compression-webpack-plugin/compare/v6.0.5...v6.1.0

Thanks!
This commit is contained in:
Piotr Błażejewicz (Peter Blazejewicz)
2020-12-22 18:17:45 +01:00
committed by GitHub
parent e57425f118
commit 9bc42ea5d4
2 changed files with 10 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ const config: Configuration = {
minRatio: 0.8,
test: /\.js$|\.html$/,
threshold: 10240,
deleteOriginalAssets: true
deleteOriginalAssets: true,
}),
new CompressionPlugin({
filename: pathData => {
@@ -27,8 +27,9 @@ const config: Configuration = {
pathData.query; // $ExpectType string
return `${pathData.path}.gz${pathData.query}`;
},
})
]
deleteOriginalAssets: 'keep-source-map',
}),
],
};
const configDefaultAlgo = new CompressionPlugin({
@@ -45,10 +46,10 @@ const zlib: Configuration = {
compressionOptions: {
flush: 5,
windowBits: 20,
level: 7
}
})
]
level: 7,
},
}),
],
};
const badZlib: Configuration = {

View File

@@ -52,9 +52,10 @@ declare namespace CompressionPlugin {
*/
cache?: boolean | string;
/**
* Whether to delete the original assets or not
* @default false
*/
deleteOriginalAssets?: boolean;
deleteOriginalAssets?: boolean | 'keep-source-map';
/**
* Exclude all assets matching any of these conditions
*/