bun icon indicating copy to clipboard operation
bun copied to clipboard

bun build should fallback to bun run build when no entrypoints are provided

Open minorcell opened this issue 1 month ago • 1 comments

What version of Bun is running?

1.3.3

What platform is your computer?

Darwin 25.1.0 arm64 arm

What steps can reproduce the bug?

  1. Add a build script to package.json:
"scripts": {
  "start": "bun run index.ts",
  "build": "bun build index.ts"
}
  1. Run bun build (no arguments):
bun build v1.3.3 (274e01c7)
error: Missing entrypoints. What would you like to bundle?

Usage:
  $ bun build <entrypoint> [...<entrypoints>] [...flags]

To see full documentation:
  $ bun build --help

What is the expected behavior?

bun build is always treated as Bun’s built-in build subcommand. However, many projects define a build script, and when users run bun build with no arguments, it’s natural to expect it to behave like bun run build. Expected: if bun build is invoked with no positional args/flags and a build script exists, Bun should fall back to running the project script (bun run build). Actual: Bun still treats it as the internal build command.

What do you see instead?

bun build v1.3.3 (274e01c7)
error: Missing entrypoints. What would you like to bundle?

Usage:
  $ bun build <entrypoint> [...<entrypoints>] [...flags]  

To see full documentation:
  $ bun build --help

Additional information

Of course, strictly speaking, this isn't a bug, but I think fixing this usage is more in line with Bun's all-in-one philosophy.

minorcell avatar Dec 04 '25 08:12 minorcell

Found 1 possible duplicate issue:

  1. https://github.com/oven-sh/bun/issues/23093

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Dec 04 '25 08:12 github-actions[bot]

Duplicate of #23093.

This issue has been automatically closed as a duplicate.

If this is incorrect, please re-open this issue or create a new one.

🤖 Generated with Claude Code

github-actions[bot] avatar Dec 07 '25 09:12 github-actions[bot]