feat(cli): support default cross-compilation targets from npmextra.json

This commit is contained in:
2026-02-09 20:24:57 +00:00
parent 97cfcac82f
commit 32e3928d19
7 changed files with 41 additions and 6 deletions

View File

@@ -119,6 +119,20 @@ dist_rust/
`tsrust` automatically installs missing rustup targets via `rustup target add` when needed.
### Configuration via npmextra.json
You can set default cross-compilation targets in your project's `npmextra.json` file so you don't need to pass `--target` flags every time:
```json
{
"@git.zone/tsrust": {
"targets": ["linux_arm64", "linux_amd64"]
}
}
```
When targets are configured in `npmextra.json`, simply running `tsrust` will cross-compile for all listed targets. CLI `--target` flags take full precedence — if any `--target` is provided, the `npmextra.json` targets are ignored entirely.
### 🗑️ Clean Only
Remove all build artifacts without rebuilding: