ts-eager
ts-eager copied to clipboard
Specify node platform in esbuild options
Currently, this defaults to "browser" (see: https://esbuild.github.io/api/#platform)
- Which then defines process.env.NODE_ENV to development OR production based on the minification option.
- Specifying platform=node leaves this alone so you can do
NODE_ENV=XYZ ts-eager foo.ts
Test plan:
- Added a unit test to make sure that process.env.NODE_ENV is left a lone
- test fails without the fix in register.js
npm run test,npm run lint,npx tsc,npx prettier --check .