Skip to content

Instantly share code, notes, and snippets.

View ro31337's full-sized avatar

Roman Pushkin ro31337

View GitHub Profile
$ gulp build
gulp build
[06:42:02] Using gulpfile ~/work/boilerplate/gulpfile.js
[06:42:02] Starting 'build'...
[06:42:02] Starting 'clean'...
[06:42:02] Finished 'clean' after 12 ms
[06:42:02] Starting 'copy-html'...
[06:42:02] Starting 'browserify'...
[06:42:02] Finished 'browserify' after 6.92 μs
[06:42:02] Finished 'copy-html' after 9.83 ms
$ npm install run-sequence --save-dev
var sequence = require('run-sequence');
// ...
gulp.task('build', function(callback) {
sequence('clean', ['copy-html', 'browserify'], callback);
});
// convert React components to be used in the browser
gulp.task('browserify', function() {
// nothing here for now
});
var sequence = require('run-sequence');
// ...
sequence('clean', ['copy-html', 'browserify'], callback);
'clean', ['copy-html', 'browserify'], callback
$ gulp clean
[06:15:30] Using gulpfile ~/work/boilerplate/gulpfile.js
[06:15:30] Starting 'clean'...
[06:15:30] Finished 'clean' after 18 ms
$ npm install gulp-rimraf --save-dev
var clean = require('gulp-rimraf');
// ...
// Clean dist folder
gulp.task('clean', function() {
return gulp.src('./dist', {
read: false
}).pipe(clean({
force: true
}));
});
$ gulp server
[06:28:16] Using gulpfile ~/work/boilerplate/gulpfile.js
[06:28:16] Starting 'copy-html'...
[06:28:16] Finished 'copy-html' after 16 ms
[06:28:16] Starting 'server'...
[06:28:16] Livereload started at http://localhost:35729
[06:28:16] Finished 'server' after 9.65 ms
[06:28:16] Webserver started at http://localhost:8000
var gulp = require('gulp');
var server = require('gulp-server-livereload');
gulp.task('copy-html', function() {
return gulp // note "return" keyword
.src('./src/**/*.html') // copy everything, including subdirectories
.pipe(gulp.dest('dist')); // to dist folder
});
gulp.task('server', ['copy-html'], function() {