@buxlabs/hot-reload

0.6.8 • Public • Published

hot-reload

Codeship Status for buxlabs/hot-reload

npm version

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

Readme

Keywords

Package Sidebar

Install

npm i @buxlabs/hot-reload

Weekly Downloads

2

Version

0.6.8

License

MIT

Last publish

Collaborators

  • buxlabs-dev
  • emilos