forked from hysysk/Data-Driven-Timelines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
32 lines (28 loc) · 781 Bytes
/
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
const gulp = require('gulp');
const concat = require('gulp-concat');
const rename = require('gulp-rename');
const uglify = require('gulp-uglify');
const rollup = require('rollup');
const node = require('rollup-plugin-node-resolve');
gulp.task('build:d3', async function() {
const bundle = await rollup.rollup({
entry: 'index.js',
plugins: [node()]
});
await bundle.write({
format: 'umd',
moduleName: 'd3',
dest: 'lib/d3.js'
})
});
gulp.task('build:ddt', function() {
return gulp.src(['lib/d3.js','src/**/*.js'])
.pipe(concat('ddtimelines.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('ddtimelines.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'))
});
gulp.task('watch', function() {
gulp.watch('src/*.js', ['build:ddt']);
});