For hot reloading to work with bit watch and a node server
Hot reloading doesn't work
First, I want to thank the bit team for the great support. Very responsive and helpful!
I've encountered this issue as well when trying to figure out how to modify sourced components in a separate app (to create custom behaviour).
I found this tutorial which explains that I have to build my sourced component every time I make a change. This is fairly time consuming.
It would be great if we could just modify the source (without the build step) and the app would rebundle automatically.
Thanks :) we try to be as responsive as we can!
You can use the bit watch command. It triggers a build step whenever a change is saved to a tracked file.
Just to add some more technical explanation:
When you run bit watch it will re-build your components once changed.
However, most of the time you will require your components via an absolute path (aka @bit/my-component). which means you require them from the node_modules even though they are in your src folder. this means that webpack won't watch for those changes (since it's usually doesn't watch the node_modules dir).
We plan to solve this (I'm not sure exactly how. maybe we will write a webpack plugin for example).
meantime you can use relative require to the component so webpack will change it. (but it's better to later make it absolute in the end since it has few advantages).
Another option is to change the webpack config to watch also node_modules/@bit path
bit-watch has been rewritten for upcoming release and alongside we resolved this issue. closing.