-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathgulpfile.js
70 lines (59 loc) · 1.58 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
var gulp = require('gulp');
var clean = require('gulp-clean');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var runSequence = require('run-sequence');
var del = require('del');
var browserSync = require('browser-sync');
var buildDir = 'bin/';
var javaScriptFiles = ['js/general/*.js'];
var graphJSFiles = ['js/graph/*.js'];
var barGraphJSFiles = ['js/bargraph/*.js'];
gulp.task('default', function ()
{
return gulp.src(javaScriptFiles)
.pipe(concat('js/d3jsTutorial.js'))
.pipe(gulp.dest('./'));
});
gulp.task('bargraph', function ()
{
return gulp.src(barGraphJSFiles)
.pipe(concat('js/d3jsBarGraph.js'))
.pipe(gulp.dest('./'));
});
gulp.task('graph', function ()
{
return gulp.src(graphJSFiles)
.pipe(concat('js/d3jsGraph.js'))
.pipe(gulp.dest('./'));
});
gulp.task('scripts', function ()
{
console.log('run scripts!');
return gulp.src(javaScriptFiles)
.pipe(concat('js/d3jsTutorial.js'))
.pipe(gulp.dest('./'));
});
gulp.task('sass', function ()
{
gulp.src('css/*.scss')
.pipe(sass())
.pipe(gulp.dest('css/'));
});
/** run watch **/
gulp.task('watch', function ()
{
gulp.watch('js/general/*.js', ['scripts']);
gulp.watch('js/graph/*.js', ['graph']);
gulp.watch('js/bargraph/*.js', ['bargraph']);
//gulp.watch('css/**/*.scss', ['sass']);
});
gulp.task('startBrowser', function ()
{
browserSync({
server: {
baseDir: './'
}
})
});