npm install gulp-cli -g
npm install gulp -D
touch gulpfile.js
gulp --help
By preferring code over configuration, node best practices, and a minimal API surface - gulp makes things simple like never before.
Using the power of node streams, gulp gives you fast builds that don't write intermediary files to disk.
By enforcing strict guidelines, we ensure our plugins stay simple and work as expected.
var gulp = require('gulp');
var pug =
require('gulp-pug');
var less =
require('gulp-less');
var minifyCSS =
require('gulp-csso');
gulp.task('html', function(){
return gulp.src(
'client/templates/*.pug'
)
.pipe(pug())
.pipe(gulp.dest(
'build/html'
))
});
gulp.task('css', function(){
return gulp.src(
'client/templates/*.less'
)
.pipe(less())
.pipe(minifyCSS())
.pipe(gulp.dest(
'build/css'
))
});
gulp.task('default',
[ 'html', 'css' ]
);