@buxlabs/hot-reload
v0.6.8
Published
hot reload tcp-websocket server
Downloads
27
Readme
hot-reload
npm install @buxlabs/hot-reload
websocket server for hot reloads in single page apps
The server acts as a proxy - it emits received data as an ws event that can be listened to in a front-end app
start
The server works on port 10009 by default, to start it run:
node bin/ws
To override the port simply:
PORT=12345 node bin/ws
motivation
Watching dist files is a common solution for hot reload, it has some disadvantages though:
- it might have an uncomfortable latency for bigger apps or consume a lot of memory/cpu usage,
- it's tricky to test
The second server approach lets you:
- keep websocket dependency out of your app,
- ignore file watching by sending a request on save instead