-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
45 lines (34 loc) · 1016 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
33
34
35
36
37
38
39
40
41
42
43
44
45
var gulp = require('gulp'),
rename = require('gulp-rename'),
coffee = require('gulp-coffee'),
less = require('gulp-less'),
sourcemaps = require('gulp-sourcemaps'),
Q = require('q');
gulp.task('serve', function() {
require('coffee-script/register');
var host = '0.0.0.0';
var port = +(process.env.PORT || 5000);
require('./src/server.coffee').serve(host, port);
return Q.defer().promise;
});
gulp.task('build', function() {
gulp.src('./src/layout.coffee')
.pipe(sourcemaps.init())
.pipe(coffee())
.pipe(rename('forceLayout.js'))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('dist'));
gulp.src('src/layout.less')
.pipe(less())
.pipe(rename('forceLayout.css'))
.pipe(gulp.dest('dist'))
gulp.src('./src/schviz.coffee')
.pipe(coffee())
.pipe(gulp.dest('dist'));
});
gulp.task('auto', function() {
gulp.start('build');
gulp.watch('src/**/*', ['build']);
});
gulp.task('devel', ['auto', 'serve']);
gulp.task('default', ['build']);