Last active
August 29, 2015 14:06
-
-
Save ajschlosser/3ac4e7c15eb43703b8d5 to your computer and use it in GitHub Desktop.
A very basic gulpfile.js for web development (with Jade and PHP support).
This file contains 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
/* | |
* Base Gulp.js workflow | |
* for simple front-end projects | |
* author: Aaron John Schlosser | |
* url: http://www.aaronschlosser.com | |
*/ | |
var gulp = require("gulp"), | |
gutil = require("gulp-util"), | |
concat = require("gulp-concat"), | |
watch = require("gulp-watch"), | |
compass = require("gulp-compass"), | |
jade = require("gulp-jade-php"), | |
plumber = require("gulp-plumber") | |
var paths = { | |
styles: { | |
src: "./scss/**/*.scss", | |
dest: "./stylesheets" | |
}, | |
templates: { | |
src: "./templates/**/*.jade", | |
dest: "./" | |
} | |
}; | |
function handleError(err) { | |
console.log(err.toString()); | |
this.emit('end'); | |
} | |
gulp.task("styles", function() { | |
return gulp.src(paths.styles.src) | |
.pipe(plumber()) | |
.pipe(compass({ | |
css: "./stylesheets", | |
sass: "./scss", | |
image: "./images" | |
})) | |
.on('error', handleError) | |
.pipe(plumber.stop()) | |
.pipe(gulp.dest(paths.styles.dest)); | |
}); | |
gulp.task("templates", function() { | |
gulp.src("./templates/**/*.jade") | |
.pipe(plumber()) | |
.pipe(jade()) | |
.pipe(plumber.stop()) | |
.pipe(gulp.dest("./")); | |
}); | |
gulp.task("default", function() { | |
gulp.watch(paths.styles.src, ["styles"]); | |
gulp.watch(paths.templates.src, ["templates"]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To install dependencies, run the following command in the same directory as gulpfile.js: