Created
October 15, 2015 20:50
-
-
Save eperedo/e63578970b82eedc61a9 to your computer and use it in GitHub Desktop.
Browser sync with gulp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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 <[email protected]>", | |
"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