Last active
August 29, 2015 14:21
-
-
Save matthewrwilton/7b5d019bcf0f9ed5940a to your computer and use it in GitHub Desktop.
Basic gulpfile.js setup with a task to compile LESS to CSS and a task to watch for changes to LESS files and recompile.
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"), | |
gulpWatch = require("gulp-watch"), | |
less = require("gulp-less"), | |
sourcemaps = require("gulp-sourcemaps"); | |
gulp.task("less", function () { | |
return gulp.src("./Content/Less/Site.less") | |
.pipe(sourcemaps.init()) | |
.pipe(less()) | |
.pipe(sourcemaps.write("../Content")) | |
.pipe(gulp.dest("./Content")); | |
}); | |
gulp.task("watch", function () { | |
gulpWatch(["./Content/Less/*.less"], function () { gulp.start("less") }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment