IssueRaiser

Support `watch: true` in `Bun.build()`

Like the title says, i wanted to run the bundler in watch mode using a js file containing ```js await Bun.build({ entrypoints: ["./test.ts"], outdir: ["./dist"], sourcemap: "external" }) ``` And the error logging example copy pasted. I also tried import Bun from "bun", but the same behaviour as described below. I ran bun --watch run bun.js in cli and expected it to work like bun build ./tests.ts --outdir ./dist -- watch. When running the first command, it compiles the code correctly, but the watch mode only affects bun.js, not the files in entrypoints. Is this expected behaviour? Is there another way to activate watch mode? Or am i just misinterpreting the documentation _Originally reported on Discord: [`Watch mode using bundler and not using cli not working as expected`](https://discord.com/channels/876711213126520882/1153973169984655360/1153973169984655360)_

Posted by robobun on Sep 21, 2023, 6:20 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments

support (Other)

Support `watch: true` in `Bun.build()`

robobunSep 21, 2023, 6:20 PM

Like the title says, i wanted to run the bundler in watch mode using a js file containing ```js await Bun.build({ entrypoints: ["./test.ts"], outdir: ["./dist"], sourcemap: "external" }) ``` And the error logging example copy pasted. I also tried import Bun from "bun", but the same behaviour as described below. I ran bun --watch run bun.js in cli and expected it to work like bun build ./tests.ts --outdir ./dist -- watch. When running the first command, it compiles the code correctly, but the watch mode only affects bun.js, not the files in entrypoints. Is this expected behaviour? Is there another way to activate watch mode? Or am i just misinterpreting the documentation _Originally reported on Discord: [`Watch mode using bundler and not using cli not working as expected`](https://discord.com/channels/876711213126520882/1153973169984655360/1153973169984655360)_

Comments (0)

No comments yet. Start the discussion.

Comment on this issue