forked from cesarbarone/angular-viacep
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
53 lines (45 loc) · 1.23 KB
/
gulpfile.js
File metadata and controls
53 lines (45 loc) · 1.23 KB
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
44
45
46
47
48
49
50
51
52
53
// #hack for fix Promise is not defined from gulp-usemin
// global.Promise = require('bluebird');
var gulp = require('gulp'),
rename = require("gulp-rename"),
coffee = require('gulp-coffee'),
gutil = require('gulp-util'),
uglify = require('gulp-uglify'),
del = require('del'),
Server = require('karma').Server;
gulp.task('test', function (done) {
new Server({
configFile: __dirname + '/karma.conf.coffee',
singleRun: true
}, done).start();
});
gulp.task('clean:dist', function (cb) {
console.log('Cleaning dist/ ...');
return del([
'dist/**/*',
], cb);
});
gulp.task('clean:tmp', ['clean:dist'], function (cb) {
console.log('Cleaning tmp/ ...');
return del([
'tmp/**/*',
], cb);
});
gulp.task('coffee:dist', ['clean:tmp'], function() {
return gulp.src('./src/*.coffee')
.pipe(coffee({bare: true}).on('error', gutil.log))
.pipe(gulp.dest('./tmp/'));
});
gulp.task('copy:js', ['coffee:dist'], function() {
gulp.src('./tmp/**/*')
.pipe(gulp.dest('./dist/'))
});
gulp.task('compress', ['copy:js'], function() {
return gulp.src('tmp/*.js')
.pipe(uglify())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist'));
});
gulp.task('dist',['compress']);