Skip to content

Instantly share code, notes, and snippets.

@chodorowicz
Last active September 1, 2018 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chodorowicz/65b4dcac63daff63ddd6fb8681deba81 to your computer and use it in GitHub Desktop.
Save chodorowicz/65b4dcac63daff63ddd6fb8681deba81 to your computer and use it in GitHub Desktop.
BrowserSync custom host domain + snippet options
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,
},
},
});
@LC43
Copy link

LC43 commented Sep 1, 2018

still works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment