0.4.2 • Published 10 years ago
browserify-patch-server v0.4.2
Browserify patch server
Because we need HMR an analog for webpack's webpack-dev-server
Requirements
node > 0.10 or io.js > 2.0 installed
Install
npm install browserify-patch-server --save-devGetting started
Start browserify-patch-server:
node_modules/.bin/bfps bundles/file.jsor
node_modules/.bin/browserify-patch-server bundles/file.jsWith browserify-patch-server you can also track multiple bundles:
node_modules/.bin/browserify-patch-server bundles/file.js bundles/file2.jsNow you need to have a client which will connect to localhost:<port>. After establishing connection you'll start receiving messages:
- Bundle has been changed successfully:
{
"bundle": BundleName <String>,
"patch": Patch <String>
}- Bundle has syntax error:
{
"bundle": BundleName <String>,
"error": Error <String>
}Also, once your client will connect to the server it'll receive an initial bundle(s) and message that connection has been established:
{
"message": "Connected to browserify-patch-server",
"sources": sources <Array>,
}Examples
Feel free to submit your example!
Configuration
By default, browserify-patch-server use port 8081 for websocket server. If you want to change this port you need to specify -p or --port parameter:
node_modules/.bin/browserify-patch-server bundles/file.js -p 8888