-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathgulpfile.js
43 lines (35 loc) · 1.1 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
(() => {
'use strict';
const gulp = require('gulp');
const babel = require('gulp-babel');
const sourcemaps = require('gulp-sourcemaps');
const webserver = require('gulp-webserver');
const sass = require('gulp-sass');
gulp.task('js:build', () => {
return gulp.src('js/timeline-chart.js')
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'));
});
gulp.task('js:watch', () => {
return gulp.watch('js/*', ['js:build']);
});
gulp.task('css:build', function () {
return gulp.src('./scss/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./dist'));
});
gulp.task('css:watch', () => {
return gulp.watch('scss/*', ['css:build']);
});
gulp.task('serve', () => {
gulp.src('./')
.pipe(webserver({
livereload: true,
directoryListing: true,
open: true
}));
});
gulp.task('default', ['js:watch', 'css:watch', 'serve']);
})();