Last active
September 1, 2018 14:27
-
-
Save chodorowicz/65b4dcac63daff63ddd6fb8681deba81 to your computer and use it in GitHub Desktop.
BrowserSync custom host domain + snippet options
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').create(); | |
const port = process.env.PORT || 8080; | |
const customDomain = environment.DEV_DOMAIN ? `${environment.DEV_DOMAIN}` : 'localhost'; | |
browserSync.init('**/*.css', { | |
logPrefix: 'Showroom:', | |
proxy: `localhost:${port}`, | |
open: false, | |
host: customDomain, | |
port: 3000, | |
ghostMode: false, /* don't mirror interactions in other browsers */ | |
snippetOptions: { | |
rule: { | |
match: /<\/body>/i, | |
fn: (snippet) => snippet, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
still works :)