Skip to content

Instantly share code, notes, and snippets.

@numbfall
Created September 20, 2023 22:13
Show Gist options
  • Save numbfall/2c6c53e1436c5b5a49a33983ec5321a6 to your computer and use it in GitHub Desktop.
Save numbfall/2c6c53e1436c5b5a49a33983ec5321a6 to your computer and use it in GitHub Desktop.
Basic gulpjs-browsersync setup
const { watch, src, dest } = require('gulp');
const browserSync = require('browser-sync').create();
function browsersyncServe(){
browserSync.init({
server: {
baseDir: '.'
}
});
};
function browsersyncReload(cb){
browserSync.reload();
cb();
};
exports.default = function(){
browsersyncServe();
watch('assets/css/styles.css', browsersyncReload);
watch('index.html', browsersyncReload);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment