-
Notifications
You must be signed in to change notification settings - Fork 6
/
gulpfile.js
42 lines (32 loc) · 887 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
"use strict";
var gulp = require('gulp');
var concat = require('gulp-concat');
var stylus = require('gulp-stylus');
var srcFiles = [
'src/helper.js',
'src/graph.js',
'src/sort.js',
'src/viewmodel.js',
'src/main.js',
];
var destSrc = 'app.js';
var destDir = 'app/js';
var stylusFiles = 'app/css/*.styl';
var stylusDestDir = 'app/css';
gulp.task('default', ['build']);
gulp.task('watch', function() {
gulp.watch(srcFiles, ['js']);
gulp.watch(stylusFiles, ['stylus']);
});
gulp.task('build', ['js', 'stylus']);
gulp.task('js', function() {
return gulp.src(srcFiles)
.pipe(concat(destSrc))
.pipe(gulp.dest(destDir));
});
gulp.task('stylus', function() {
gulp.src(stylusFiles)
.pipe(stylus())
.on('error', function(err) { console.error(err.message) })
.pipe(gulp.dest(stylusDestDir));
});