forked from idfly/angular-class-coffee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (31 loc) · 917 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
var gulp = require('gulp');
var util = require('gulp-util');
var sourcemaps = require('gulp-sourcemaps');
var coffee = require('gulp-coffee');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
gulp.task('compile-coffee', function() {
return gulp
.src(['angular-class.coffee'])
.pipe(sourcemaps.init())
.pipe(coffee())
.on('error', function(message) {
util.log(util.colors.red(message));
this.end();
})
.pipe(sourcemaps.write())
.pipe(gulp.dest('build'));
});
gulp.task('minify-coffee', function() {
return gulp
.src(['angular-class.coffee'])
.pipe(coffee())
.pipe(uglify())
.pipe(rename(function(path) { path.basename += '.min' }))
.on('error', function(message) {
util.log(util.colors.red(message));
this.end();
})
.pipe(gulp.dest('build'));
});
gulp.task('default', ['compile-coffee', 'minify-coffee']);