mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
feat(bundler): expose reactFastRefresh option in Bun.build API (#25731)
Fixes #25716 Adds support for a `reactFastRefresh: boolean` option in the `Bun.build` JavaScript API, matching the existing `--react-fast-refresh` CLI flag. ```ts const result = await Bun.build({ reactFastRefresh: true, entrypoints: ["src/App.tsx"], }); ``` When enabled, the bundler adds React Fast Refresh transform code (`$RefreshReg$`, `$RefreshSig$`) to the output.
This commit is contained in:
10
packages/bun-types/bun.d.ts
vendored
10
packages/bun-types/bun.d.ts
vendored
@@ -1942,6 +1942,16 @@ declare module "bun" {
|
||||
development?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Enable React Fast Refresh transform.
|
||||
*
|
||||
* This adds the necessary code transformations for React Fast Refresh (hot module
|
||||
* replacement for React components), but does not emit hot-module code itself.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
reactFastRefresh?: boolean;
|
||||
|
||||
outdir?: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user