Last active
April 3, 2017 02:43
-
-
Save yocontra/5924386 to your computer and use it in GitHub Desktop.
Ideal build system
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 = require 'gulp' | |
clean = require 'gulp-clean' | |
jade = require 'gulp-jade' | |
coffee = require 'gulp-coffee' | |
minify = require 'gulp-minify' | |
### | |
quick syntax ideas: | |
gulp.files() takes a glob and is an array of file streams | |
gulp.folder() is like gulp.files("./folder/**/*") but it maintains directory structure | |
you can pipe a .folder() or a .files() to another .folder() | |
.files() and .folder() both take an options argument: | |
"ignore" is an array which should follow the same syntax and behaviour as a .gitignore file | |
### | |
# wipe the public folder | |
gulp.folder("./public").pipe(clean) | |
# compile, minify, and copy templates | |
gulp.folder("./client/templates") | |
.pipe(jade) | |
.pipe(minify) | |
.pipe(gulp.folder("./public/templates")) | |
# compile, minify, and copy all coffee-script | |
gulp.folder("./client/js", {ignore:["vendor"]}) | |
.pipe(coffee) | |
.pipe(minify) | |
.pipe(gulp.folder("./public/js")) | |
# minify and copy all vendor files | |
gulp.folder("./client/js/vendor") | |
.pipe(minify) | |
.pipe(gulp.folder("./public/js/vendor")) | |
# copy static files | |
gulp.folder("./client/img") | |
.pipe(gulp.folder("./public/img")) | |
gulp.folder("./client/css") | |
.pipe(gulp.folder("./public/css")) | |
gulp.files("./client/*.html") | |
.pipe(gulp.folder("./public")) | |
gulp.files("./client/*.ico") | |
.pipe(gulp.folder("./public")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good point.
lol, nice....