-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.js
42 lines (36 loc) · 1.05 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Promise polyfill.
var Promise = require('es6-promise').Promise;
// Gulp itself.
var gulp = require('gulp');
// Less and CSS stuff.
var less = require('gulp-less');
var prefix = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');
var coffee = require('gulp-coffee');
// Compile all the Less.
gulp.task('less', function () {
gulp.src(['./src/less/*.less'])
.pipe(less())
.pipe(prefix(
"last 1 version", "> 1%", "ie 8", "ie 7"
))
.pipe(minifycss()) // Minify resulting CSS.
.pipe(gulp.dest('./web/css'));
});
// Compile all the CoffeeScript.
gulp.task('coffee', function () {
gulp.src(['./src/coffee/*.coffee'])
.pipe(coffee())
.pipe(gulp.dest('./web/js'));
});
gulp.task('watch', function() {
// Compile Less.
gulp.watch("./src/less/*.less", function(event) {
gulp.run('less');
});
// Compile CoffeeScript.
gulp.watch("./src/coffee/*.coffee", function(event) {
gulp.run('coffee');
});
});
gulp.task('default', ['less', 'coffee']);