compression = exts => compiler => {
	compiler.hooks.thisCompilation.tap("Test", compilation => {
		compilation.hooks.processAssets.tap(
			{
				name: "Test",
				stage: Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER
			},
			() => {
				for (const asset of compilation.getAssets()) {
					for (const ext of exts) {
						if (asset.name.endsWith(".jpg")) {
							continue;
						}
						const newFile = `${asset.name}${ext}`;
						compilation.emitAsset(newFile, asset.source);
						compilation.updateAsset(asset.name, asset.source, {
							related: {
								compressed: ["...", newFile]
							}
						});
					}
				}
			}
		);
	});
}
@param {string[]} exts extensions
@returns {(compiler: Compiler) => void} callback for comperssion