Last active
November 16, 2016 09:04
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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