browserify-reload

browserify-reload is a browserify plugin that reload your client side bundle everytime it gets updated (e.g. through watchify)

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
browserify-reload
311.1.16 years ago7 years agoMinified + gzip package size for browserify-reload in KB

Readme

browserify-reload is a browserify plugin that reload your client side bundle everytime it gets updated (e.g. through watchify) Version License
Motivation
I really cannot rely on express interceptor / proxy or whatever, browserify-reload provides the slimest overhead to reach an interactive client / server sync & reload. It use tiny WS server (listening on random port) and inject, through browserify-wrap a tiny boostrap prefix on your browserify bundle so it listen for a "reload" event. For convenience, you can also register additionnal file paths to be watched (once modified, they'll also trigger the client reload signal).
API
``` const reload = require('browserify-reload'); var b = bundle(); b.plugin(reload , opts) b.bundle().pipe(somewhere); ```

Options

  • { deferred : false }
Do not signal the client to reload once the bundle stream ends (so you might apply additionnal, non browserify-compliant processing afterwards BEFORE notifying the client), see opts.xfiles Monitor file paths and trigger client reload signal every time they are modified.
  • { host : (default document.location.hostname) }
WS notification host the browser will connect to
Credits
Keywords / shout box
browserify, prefix, suffix, wrapper, plugin, browserify-plugin