#--hot reload doesn't --hot reload
1 messages · Page 1 of 1 (latest)
Well, it's probably linked to this issue : https://github.com/oven-sh/bun/issues/6216
bun will not watch and hot reload files which are not imported, so if you have got html files lying around and change them they will not trigger hot reloads. But for example typescript files which are imported in your entry point file will trigger a hot reload.
If want html to reload when you change html and stuff use an extension
Yep, used nodemon :
nodemon -e .pug --exec 'bun run dev'
you can import the files as text
and then it will work with the hot reloading
bun --hot --loader=.pug:text ./script.ts
Thanks, the flag made it work but like @amber bloom said, I had to manage something to require * .pug files into my entry point, I don't think that's ideal :/
(async () => {
const files = await readdir("./app", { recursive: true });
files.filter((file) => file.endsWith(".pug")).forEach((file) => require("./app/" + file));
})();```
yeah its not ideal
you could use Bun.Glob to scan for all the .pug files at least