Sometimes when unlucky tsdown will clean the dist at the same time that the emulator is checking for the dist/index.js file, which leads to it not being served correctly, requiring an additional save. It was not easy to replicate this in this smaller project, but in a bigger project a build can take longer than the hot-reload from firebase.
Two separate solutions i have found for now:
- Have firebase emulate have its own watch, instead of turbo. Applying concurrently.
or
- Have tsdown config
clean set to false
I am not sure if any of these solutions are that graceful, would be nice if we could avoid concurrently, or setting clean to false, to avoid dist changes not being applied to the serve correctly.
It does not seem possible to change how firebase hot-reloads, apart from changing the source in firebase.json to the dist folder, but requires more tweaking, and probably unwanted changes.
Sometimes when unlucky tsdown will clean the dist at the same time that the emulator is checking for the
dist/index.jsfile, which leads to it not being served correctly, requiring an additional save. It was not easy to replicate this in this smaller project, but in a bigger project a build can take longer than the hot-reload from firebase.Two separate solutions i have found for now:
or
cleanset tofalseI am not sure if any of these solutions are that graceful, would be nice if we could avoid concurrently, or setting clean to false, to avoid dist changes not being applied to the serve correctly.
It does not seem possible to change how firebase hot-reloads, apart from changing the source in
firebase.jsonto the dist folder, but requires more tweaking, and probably unwanted changes.