Created
March 6, 2016 01:13
-
-
Save ro31337/4fb440be4c1a3eaeebe4 to your computer and use it in GitHub Desktop.
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 watch = require('gulp-watch'); | |
| // ... | |
| gulp.task('watch', function() { | |
| // rebuild when jsx, js, html change, in src directory, including subdirectories | |
| watch('./src/**/*.{jsx,js,html}', function() { | |
| gulp.start('build'); | |
| }); | |
| }); | |
| // already existing "server" task | |
| gulp.task('server', ['build'], function() { | |
| gulp.start('watch'); // 1 LINE ADDED FOR "server" TASK | |
| gulp | |
| .src('./dist') // everything from ./dist directory | |
| .pipe(server({ // pipe to server object | |
| livereload: true, // reload when files are changed | |
| open: true // and open the browser | |
| })); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment