aspect-build / aspect-build/rules_ts
[FR]: Add env argument to ts_project
- Dominant language
- Starlark
- Stars
- 138
- Forks
- 87
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 3
Description
### What is the current behavior?
Currently there is no way to customize the environment variables that are set during the tsc execution.
### Describe the feature
I am attempting to adopt ts_project on my very large Typescript codebase. In order to use `tsc` without running out of memory, we need to use the `--max-old-space-size` on the node process. ts_project does not currently provide a way to do this. I propose adding an `env` option to ts_project that gets passed though to the underlying action run.
Currently, our setup looks like this:
```
typescript_bin.tsc(
name = "src_transpiled",
args = [
"-p",
"tsconfig.json",
],
chdir = package_name(),
out_dirs = ["dist"],
srcs = glob([
"src/**/*"
]) + [
"tsconfig.json",
],
env = {
"NODE_OPTIONS": "--max-old-space-size=10240",
},
visibility = ["//visibility:public"],
)
```
Contributor guide
Research direction
Start by locating the ts_project implementation and the underlying action invocation referenced in the issue. Add the env option so values such as NODE_OPTIONS reach the tsc execution, then verify that a ts_project target can customize its environment without changing existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100