-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathgulpfile.js
42 lines (35 loc) · 997 Bytes
/
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
// run 'npm install' and 'gulp'
var gulp = require('gulp');
var gutil = require('gulp-util');
var coffee = require('gulp-coffee');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var uglify = require('gulp-uglify');
var paths = {
styles: {
src: 'app/scss/**/*.scss',
dest: 'app/css'
},
scripts: {
src: 'app/coffee/**/*.coffee',
dest: 'app/js'
}
};
gulp.task('styles', function() {
return gulp.src(paths.styles.src)
.pipe(sass({errLogToConsole: true}))
.pipe(autoprefixer(['last 2 versions', "ie 8"]))
.pipe(gulp.dest(paths.styles.dest));
});
gulp.task('scripts', function() {
return gulp.src(paths.scripts.src)
.pipe(coffee())
.on('error', gutil.log)
.on('error', gutil.beep)
.pipe(gulp.dest(paths.scripts.dest));
});
gulp.task('watch', function() {
gulp.watch(paths.scripts.src, ['scripts']);
gulp.watch(paths.styles.src, ['styles']);
});
gulp.task('default', ['styles', 'scripts', 'watch']);