aws/aws-cdk

core: configurable ZIP compression level

Open

#22,427 建立於 2022年10月8日

在 GitHub 查看
 (3 留言) (1 反應) (0 負責人)TypeScript (10,710 star) (3,530 fork)batch import
@aws-cdk/coreeffort/smallfeature-requestgood first issuep2

描述

Describe the feature

I noticed that the ZIP files produced by CDK are quite a bit larger than those produced, for example, by the "Compress" functionality in macOS Finder for the same content.

The feature request is that the compression level of zlib used in the ZIP compression is made configurable by the user (a speed vs compression ratio trade-off). This could be beneficial, for example, to produce as small packages as possible for Lambda functions.

Use Case

ZIP files produced as CDK assets (e.g., bundled JS Lambda code/sourcemaps) are larger than they could be.

Proposed Solution

Expose the level setting of zlib, which is exposed by the archiver library which seems to be used by CDK for ZIP packages (see https://www.npmjs.com/package/archiver)

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.43.1

Environment details (OS name and version, etc.)

macOS 12.5.1

貢獻者指南