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
| $ gulp server |
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
| <body> | |
| Hello, world! | |
| </body> |
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
| <body> | |
| Hello, world! |
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'); | |
| }); | |
| }); |
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
| gulp.task('server', ['build'], function() { | |
| 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 | |
| })); | |
| }); |
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
| $ npm install gulp-watch --save-dev |
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
| [08:50:41] Finished 'build' after 28 ms | |
| [08:50:41] Starting 'server'... |
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
| $ gulp server | |
| [06:50:41] Using gulpfile ~/work/boilerplate/gulpfile.js | |
| [06:50:41] Starting 'build'... | |
| [06:50:41] Starting 'clean'... | |
| [06:50:41] Finished 'clean' after 18 ms | |
| [06:50:41] Starting 'copy-html'... | |
| [06:50:41] Starting 'browserify'... | |
| [06:50:41] Finished 'browserify' after 9.41 μs | |
| [06:50:41] Finished 'copy-html' after 8.17 ms | |
| [06:50:41] Finished 'build' after 28 ms |
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 server = require('gulp-server-livereload'); | |
| var clean = require('gulp-rimraf'); | |
| var sequence = require('run-sequence'); | |
| gulp.task('build', function(callback) { | |
| sequence('clean', ['copy-html', 'browserify'], callback); | |
| }); | |
| // Clean dist folder |
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
| gulp.task('server', ['build'], function() { | |
| // ... |