Skip to content

Commit

Permalink
docs: add notes for --env flag (#1230)
Browse files Browse the repository at this point in the history
  • Loading branch information
typed-sigterm authored Oct 12, 2024
1 parent ec53f28 commit a62da26
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ You can use `--env` flag to define compile-time environment variables:
tsup src/index.ts --env.NODE_ENV production
```
Note that `--env.VAR_NAME` only recognizes `process.env.VAR_NAME` and `import.meta.env.VAR_NAME`. If you use `process.env`, it will only take effect when it is used as a built-in global variable. Therefore, do not import `process` from `node:process`.
### Building CLI app
When an entry file like `src/cli.ts` contains hashbang like `#!/bin/env node` tsup will automatically make the output file executable, so you don't have to run `chmod +x dist/cli.js`.
Expand Down

0 comments on commit a62da26

Please sign in to comment.