ts-eager icon indicating copy to clipboard operation
ts-eager copied to clipboard

Specify node platform in esbuild options

Open ymichael opened this issue 4 years ago • 0 comments

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 .

ymichael avatar Jun 22 '21 22:06 ymichael