Closed noahehall closed 8 months ago
@noahehall can you share a simple repo with this fake watcher that you did too see how can I use it?
I tried the react template and to try to solve the hot module problem, I'm forcing the assets build in every request but, it doesn't serve with the updated asset: I have to force cache reload on the browser, something like ctrl + shift + r
on win.
async function buildFiles() {
return await Bun.build({
entrypoints: ["./src/index.tsx"],
outdir: "./build",
});
}
and then
const server = Bun.serve({
fetch(request) {
buildFiles();
...
}
@devmozao check this file
https://github.com/noahehall/react-idealer-image/blob/develop/cosmos.bunserver.ts
the hack is straight forward when you think about it:
while this won't hot reload your front end it will hot reload your dev server and enable you to refresh the browser
in your example code, add the following and make sure you start the server with --watch
await import(src/index.tsx).catch(e => e)
any update? i missing somthing about fast refresh setup
Not right now, but we plan to make this better in the future.
What is the type of issue?
Documentation is missing
What is the issue?
according to the
bun vs esbuild
docsHowever, I managed to fake file watching with the react template with
this file is then imported into the dev server
is there a better way to do this without adding nodemon or similar?
Where did you find it?