-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.babel.js
36 lines (29 loc) · 1007 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
'use strict';
import gulp from 'gulp'
import babel from 'gulp-babel'
import sass from 'gulp-sass'
import sourcemaps from 'gulp-sourcemaps'
import plumber from 'gulp-plumber'
gulp.task('babel', () => {
return gulp.src('functree/static/src/js/*.js')
.pipe(sourcemaps.init())
.pipe(plumber())
.pipe(babel())
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('functree/static/dist/js'));
});
gulp.task('babel:watch', () => {
return gulp.watch('functree/static/src/js/*.js', ['babel']);
});
gulp.task('sass', () => {
return gulp.src('functree/static/src/scss/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({'outputStyle': 'compressed'}).on('error', sass.logError))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('functree/static/dist/css'));
});
gulp.task('sass:watch', function () {
return gulp.watch('functree/static/src/scss/*.scss', ['sass']);
});
gulp.task('build', ['babel', 'sass']);
gulp.task('default', ['build']);