forked from erictonussi/drumjs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
52 lines (44 loc) · 1.2 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
44
45
46
47
48
49
50
51
52
/**
* Created by Keith on 4/19/2017.
*/
var gulp = require('gulp');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var uglifyjs = require('gulp-uglify');
var uglifycss = require('gulp-uglifycss');
var rename = require('gulp-rename');
function logError(e){
console.log(e.cause);
}
gulp.task('drum.js', function(){
var files = [
'src/js/Drum.js'
, 'src/js/DrumButton.js'
];
return gulp.src(files)
.pipe(concat('drum.js'))
.pipe(gulp.dest('dist'))
;
});
gulp.task('drum.css', function(){
var files = [
'src/scss/drum.scss'
];
return gulp.src(files)
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('dist'))
;
});
gulp.task('drum.min.js', ['drum.js'], function(){
return gulp.src('dist/drum.js')
.pipe(uglifyjs().on('error', logError))
.pipe(rename('drum.min.js'))
.pipe(gulp.dest('dist'))
});
gulp.task('drum.min.css', ['drum.css'], function(){
return gulp.src('dist/drum.css')
.pipe(uglifycss().on('error', logError))
.pipe(rename('drum.min.css'))
.pipe(gulp.dest('dist'))
});
gulp.task('default', ['drum.min.js', 'drum.min.css']);