-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
43 lines (36 loc) · 1.1 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
43
var gulp = require('gulp');
var coffee = require('gulp-coffee');
var sass = require('gulp-ruby-sass');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var autoprefixer = require('gulp-autoprefixer');
var jade = require('gulp-jade');
var paths = {
scripts: ['assets/coffee/*.coffee'],
css: ['assets/scss/*.scss']
};
gulp.task('templates', function() {
return gulp.src('*.jade')
.pipe(jade({
pretty: true
}))
.pipe(gulp.dest('./'));
});
gulp.task('scss', function() {
return gulp.src(paths.css)
.pipe(sass({ style: 'expanded' }))
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(gulp.dest('./stylesheets'))
});
gulp.task('scripts', function() {
return gulp.src(paths.scripts)
.pipe(coffee({bare: true}))
.pipe(uglify())
.pipe(gulp.dest('./javascripts'));
});
gulp.task('watch', function() {
gulp.watch(paths.scripts, ['scripts']);
gulp.watch(paths.css, ['scss']);
gulp.watch('*.jade', ['templates']);
});
gulp.task('default', ['scripts', 'scss', 'templates', 'watch']);