-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.babel.js
40 lines (33 loc) · 961 Bytes
/
gulpfile.babel.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
'use strict';
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const minifyCSS = require('gulp-minify-css');
const gulp = require('gulp');
const babel = require('gulp-babel');
let compiledDirectory = type => 'assets/compiled/' + type;
let jsFiles = [
'js/constants.js',
'js/utils/*.js',
'js/chord-map.js',
'js/example-progressions.js',
'js/components/**/*.js',
'js/app.js',
];
gulp.task('scripts', function() {
gulp.src('css/*.css')
.pipe(concat('all.css'))
.pipe(minifyCSS())
.pipe(gulp.dest(compiledDirectory('css')));
gulp.src('js/vendor/*.js')
.pipe(concat('vendor.all.js'))
.pipe(uglify())
.pipe(gulp.dest(compiledDirectory('js')));
return gulp.src(jsFiles)
.pipe(concat('all.min.js'))
.pipe(babel({ presets: ['es2015'] }))
.pipe(uglify())
.pipe(gulp.dest(compiledDirectory('js')));;
});
gulp.task('watch', function() {
gulp.watch(['js/**/*.js', 'css/*.css'], ['scripts']);
});