Created
April 2, 2025 18:50
-
-
Save webstrand/7dd5347d0ed77fea9c13e0713acd2b5d to your computer and use it in GitHub Desktop.
Compile one file in a project using `tsc`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S unshare -Umr -- bash | |
set -euo pipefail; | |
tmpfile=$(mktemp); | |
cpp -P -E tsconfig.json | FILE=$1 jq '.files = [env.FILE] | del(.include)' > $tmpfile; | |
mount --bind $tmpfile tsconfig.json; | |
rm $tmpfile; | |
exec pnpm exec tsc -p tsconfig.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment