aspect-build / aspect-build/rules_esbuild
[FR]: control `minify` behavior with a flag
- Dominant language
- Starlark
- Stars
- 35
- Forks
- 45
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
### What is the current behavior?
Developers need to minify for production, but minified code during development is just a nuisance. This is a common pattern in compilers which can produce "stripped" or "optimized" vs. "debug" binaries.
Currently the `minify` flag has to be a boolean in the BUILD file, so developers have to manually change it, or use a `select` to make it configurable based on some command-line flag.
### Describe the feature
We should probably just honor the `--compilation_mode` flag, as many Bazel users have `--compilation_mode=opt` in their release configuration. For backwards compat, we could have trinary similar to stamping behavior:
- `minify = True` is *always* minify
- `minify = False` is *never* minify
- `minify = None` is "honor the --compilation_mode"
Contributor guide
Research direction
Start by locating the BUILD-file handling for the minify attribute and the logic that reads Bazel's --compilation_mode. Trace how the current boolean value reaches the esbuild invocation, then identify the existing tests for minify or compilation modes. Done means True and False retain their current behavior while None follows the selected compilation mode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100