Skip to content

Instantly share code, notes, and snippets.

@andrewagain
Created October 28, 2015 21:54
Show Gist options
  • Save andrewagain/0b58726838e4c169c9a9 to your computer and use it in GitHub Desktop.
Save andrewagain/0b58726838e4c169c9a9 to your computer and use it in GitHub Desktop.
browsersync rewriterules not used
node_modules
<!-- Put this file in 'app/index.html', not 'app-index.html' -->
Hello World
var bs = require("browser-sync").create();
bs.init({
server: "./app",
rewriteRules: [
{
match: /Hello/ig,
fn: function(match) {
console.log('MATCH!!!!');
return 'Cello';
},
},
{
match: 'Hello',
replace: 'Shmello',
},
],
});
{
"name": "browsersync-bug",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"browser-sync": "^2.9.11"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment