Skip to content

Instantly share code, notes, and snippets.

@eperedo
Created October 15, 2015 20:50
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 eperedo/e63578970b82eedc61a9 to your computer and use it in GitHub Desktop.
Save eperedo/e63578970b82eedc61a9 to your computer and use it in GitHub Desktop.
Browser sync with gulp
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
// Static server
gulp.task('default', ['browser-sync']);
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: "./src"
}
});
gulp.watch(['src/*.html', 'src/**/*.js']).on('change', browserSync.reload);
});
{
"name": "demo-clase-1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Eduardo Peredo <eduardo.peredo@abakio.com>",
"license": "MIT",
"devDependencies": {
"browser-sync": "2.9.11",
"gulp": "3.9.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment