We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build --compile
0.8.1 16b4bf341acc0f4804f0b6bdf5298c180cd00366
Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64
Make a macro to remove dead code on production build, for example:
./utils.ts
export const isDevelopment = () => process.env.NODE_ENV === "development";
./index.ts
import { isDevelopment } from "./utils" with { type: 'macro' }; if (isDevelopment()) { console.log("something only for development"); }
Finally, run bun build --compile --outfile ./bin ./index.ts
bun build --compile --outfile ./bin ./index.ts
Have a binary in ./bin
./bin
$ bun build --compile --outfile ./bin ./src/index.ts [0.01ms] ".env" [1] 13286 IOT instruction bun build --compile --outfile ./bin ./index.ts
I am doing this because for some reason, I have an error with console.logs when running the Bun binary inside a service or in PM2.
Here's the output when doing pm2 logs for example...
pm2 logs
If that shouldn't open, I can open another issue for this if needed.
The text was updated successfully, but these errors were encountered:
Does not reproduce as of Bun v1.0.7
Sorry, something went wrong.
No branches or pull requests
What version of Bun is running?
0.8.1 16b4bf341acc0f4804f0b6bdf5298c180cd00366
What platform is your computer?
Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
Make a macro to remove dead code on production build, for example:
./utils.ts
./index.ts
Finally, run
bun build --compile --outfile ./bin ./index.ts
What is the expected behavior?
Have a binary in
./bin
What do you see instead?
Additional information
I am doing this because for some reason, I have an error with console.logs when running the Bun binary inside a service or in PM2.
Here's the output when doing
pm2 logs
for example...If that shouldn't open, I can open another issue for this if needed.
The text was updated successfully, but these errors were encountered: