forked from ipiranhaa/crypto-market-price
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
52 lines (46 loc) · 1.26 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
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var uglifyjs = require('uglify-es');
var uglify = require('gulp-uglify');
var composer = require('gulp-uglify/composer');
var minify = composer(uglifyjs, console);
var pump = require('pump');
var concat = require('gulp-concat');
var clean = require('gulp-clean');
var gulpSequence = require('gulp-sequence');
var babel = require('gulp-babel');
gulp.task('default', ['sass'], function() {
gulp.watch("public/css/*.scss", ['sass']);
});
gulp.task('build', gulpSequence('compress', 'merge', 'clean', 'sass'));
gulp.task('dev', ['sass'], function() {
gulp.watch("public/css/*.scss", ['sass']);
});
gulp.task('sass', function(cb) {
pump([
sass('public/css/*.scss', {style: 'compressed'}),
gulp.dest('public/build')
], cb);
});
gulp.task('compress', function(cb) {
var options = {};
pump([
gulp.src('public/js/*.js'),
babel({presets: ['env']}),
minify(options),
gulp.dest('public/build/dist')
], cb);
});
gulp.task('merge', function(cb) {
pump([
gulp.src('public/build/dist/*.js'),
concat('build.js'),
gulp.dest('public/build/')
], cb);
});
gulp.task('clean', function(cb) {
pump([
gulp.src('public/build/dist', {read: false}),
clean()
], cb);
});