Skip to content

Instantly share code, notes, and snippets.

@acrogenesis
Created June 21, 2017 16:02
Show Gist options
  • Save acrogenesis/c653a5a4fc8d089ff83a9b9f44694460 to your computer and use it in GitHub Desktop.
Save acrogenesis/c653a5a4fc8d089ff83a9b9f44694460 to your computer and use it in GitHub Desktop.
BrowserSync with rails/gulp
gulp.task('server', function() {
browserSync.init({
proxy: {
target: 'localhost:3000',
reqHeaders: function () {
return { host: 'localhost:8000' };
}
},
port: 8000,
open: true,
notify: false,
snippetOptions: {
rule: {
match: /<\/head>/i,
fn: function (snippet, match) {
return snippet + match;
}
}
}
});
gulp.watch(paths.html).on('change', reload);
gulp.watch(paths.stylus, gulp.series('clean', 'styles'));
gulp.watch(paths.scripts, gulp.series('scripts'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment