Skip to content

Instantly share code, notes, and snippets.

@hgwood
Last active November 16, 2016 09:04
Show Gist options
  • Save hgwood/1bc0b6cc9eddc7b872a191a7c7d2aaad to your computer and use it in GitHub Desktop.
Save hgwood/1bc0b6cc9eddc7b872a191a7c7d2aaad to your computer and use it in GitHub Desktop.
Here's how to use a Browser Sync server with Brunch. Place this file along side `brunch-config.js`, and start Brunch with the `--server` option.
const browserSync = require('browser-sync');
module.exports = (port, path, callback) => {
const browserSyncServer = browserSync.create();
browserSyncServer.init({
port,
serveStatic: [path],
// Other Browser Sync options go here
}, callback);
return {close: () => browserSyncServer.exit()}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment