-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
49 lines (35 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
42
43
44
45
46
47
48
var gulp = require('gulp');
var data = require('gulp-data');
var watch = require('gulp-watch');
var stylus = require('gulp-stylus');
var gulpBrowser = require("gulp-browser");
var nunjucks = require('gulp-nunjucks');
gulp.task('default', function() {
gulp.run (['compile-styl']);
gulp.run (['compile-js']);
gulp.run (['compile-html']);
watch('./dist/css/**/*.styl', function(){
gulp.run (['compile-styl']);
});
watch('./dist/js/**/*.js', function(){
gulp.run (['compile-js']);
});
watch("./dist/templates/**/*.html", function() {
gulp.run (['compile-html']);
});
});
gulp.task('compile-styl', function(){
return gulp.src('./dist/css/style.styl')
.pipe(stylus())
.pipe(gulp.dest('./frontend/css/'));
});
gulp.task('compile-js', function(){
return gulp.src('./dist/js/*.js')
.pipe(gulpBrowser.browserify())
.pipe(gulp.dest('./frontend/js/'));
});
gulp.task('compile-html', function(){
return gulp.src('./dist/templates/index.html')
.pipe(nunjucks.compile())
.pipe(gulp.dest('./frontend/templates/'));
});