-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
72 lines (64 loc) · 1.76 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
69
70
71
72
var gulp = require('gulp'),
watch = require('gulp-watch'),
del = require('del'),
plumber = require('gulp-plumber'),
concat = require('gulp-concat'),
runSequence = require('run-sequence'),
livescript = require('gulp-livescript'),
livereload = require('gulp-livereload');
gulp.task("clean", function (cb) {
return del(['test','polymorph.js'],cb);
});
gulp.task("watch", function () {
livereload.listen();
watch('lib/html/**/*.html', function (files, cb) {
gulp.start("build-html",cb);
});
watch('lib/ls/**/*.ls', function (files, cb) {
gulp.start("build-js");
});
});
gulp.task("build-html", function () {
return gulp.src('lib/html/*.html').
pipe(plumber()).
pipe(gulp.dest("test/")).
pipe(livereload());
});
gulp.task("build-js", function () {
gulp.src(['lib/ls/polymorph.ls']).
pipe(plumber()).
pipe(livescript({bare: true})).
pipe(gulp.dest("./")).
pipe(livereload());
return gulp.src([
'lib/ls/test.ls',
'lib/ls/polymorph.ls',
'lib/ls/logic.ls'
]).
pipe(plumber()).
pipe(livescript({bare: true})).
pipe(gulp.dest("test/"));
// pipe(livereload());
});
gulp.task("build-data", function () {
return gulp.src('lib/data/*').
pipe(gulp.dest("test/"));
});
gulp.task("build-js-components", function () {
return gulp.src([
'node_modules/async/lib/async.js',
'node_modules/d3/d3.min.js',
'node_modules/topojson/topojson.min.js'
]).
pipe(concat('components.js')).
pipe(gulp.dest('test/'));
});
// Run all the listeners and such for development
gulp.task("default", function (cb) {
runSequence('clean', // Clean first
['build-html', // These in parallel
'build-js',
'build-js-components',
'build-data',
'watch'],cb);
});