-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
41 lines (34 loc) · 1.02 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
var gulp = require('gulp'),
connect = require('gulp-connect');
uglify = require('gulp-uglify');
less = require('gulp-less');
rename = require('gulp-rename');
gulp.task('connect', ['html', 'js', 'less', 'img'],function() {
connect.server({
root: "dist",
port: 8989
});
});
gulp.task('html', function() {
return gulp.src('./index.html')
.pipe(gulp.dest('./dist'));
});
gulp.task('js', function() {
return gulp.src(['./src/d3_shape_filler_chart.js', './bower_components/d3/d3.min.js'])
.pipe(gulp.dest('./dist'));
});
gulp.task('less', function() {
return gulp.src('./src/d3_shape_filler_chart.less')
.pipe(less())
.pipe(gulp.dest('./dist'));
});
gulp.task('img', function() {
return gulp.src(['./src/*.svg'])
.pipe(gulp.dest('./dist'));
});
gulp.task('watch', function () {
gulp.watch(['./src/d3_shape_filler_chart.js'], ['js']);
gulp.watch(['./src/d3_shape_filler_chart.less'], ['less']);
gulp.watch(['./index.html'], ['html']);
});
gulp.task('default', ['connect', 'watch']);