My objective is to pass arguments through the command line using yarn start to index.ts
.
"scripts": {
"start": "tsc-watch --onSuccess \"ts-node --pretty -r tsconfig-paths/register' src/index.ts\"",
}
When I attempt something like:
yarn start --matchId 5eb8d34d9bdbf3735005fc3d
I encountered:
$ tsc-watch --onSuccess "ts-node --pretty -r tsconfig-paths/register' src/index.ts" --matchId 5eb8d34d9bdbf3735005fc3d error TS5023: Unknown compiler option '--matchId'.
How can I successfully pass variables through the command line to the index.ts script?