aws-amplify / aws-amplify/amplify-cli

minify built CloudFormation templates by default

Open
#12,624 0 comments 2 reactions 0 assignees View on GitHub
feature-request p4 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Is this feature request related to a new or existing Amplify category?

_No response_

### Is this related to another service?

_No response_

### Describe the feature you'd like to request

Amplify CLI currently supports a `--minify` flag to minify CloudFormation templates, however now that the templates are generated on `amplify build` (which is invoked on `push`) and these templates do not support manual edits it would make sense to minify by default.

Sometimes [a template can inflate passed the 1MB limit](https://github.com/aws-amplify/amplify-category-api/issues/1453), which can be mitigated by running `amplify push --minify`. This effectively reduces the size of CloudFormation templates by almost 70% and can decrease file upload times.

### Describe the solution you'd like

- minify generated CloudFormation templates by default
- remove the `--minify` flag
- optionally provide an opt-out (though since these files are only used by developers for inspection - like to verify override changes - they can be easily formatted with tools such as VSCode and Prettier)

### Describe alternatives you've considered

always passing `--minify`

### Additional context

_No response_

### Is this something that you'd be interested in working on?

- [X] 👋 I may be able to implement this feature request

### Would this feature include a breaking change?

- [ ] ⚠️ This feature might incur a breaking change

Contributor guide

Open the contributing guide

Research direction

Start by locating the CLI implementation of the --minify flag and the CloudFormation template generation paths invoked by amplify build and amplify push. Determine how the default behavior and any opt-out should work, then verify that generated templates are minified and the existing flag behavior is removed or replaced without breaking uploads.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cli, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.