-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
60 lines (50 loc) · 1.64 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
var gulp = require('gulp'),
gutil = require('gulp-util'),
uglify = require('gulp-uglify'),
jade = require('gulp-jade'),
sass = require('gulp-sass'),
coffeeify = require('gulp-coffeeify'),
concat = require('gulp-concat'),
livereload = require('gulp-livereload'),
tinylr = require('tiny-lr'),
express = require('express'),
app = express(),
path = require('path'),
server = tinylr();
// --- Basic Tasks ---
gulp.task('sass', function () {
gulp.src('./src/app/assets/css/app.scss')
.pipe(sass())
.pipe(gulp.dest('./dist/app/assets/css/'))
.pipe(livereload( server ));
});
gulp.task('coffee', function() {
return gulp.src('src/**/*.coffee')
.pipe( coffeeify() )
// .pipe( uglify() )
// .pipe( concat('all.min.js'))
.pipe( gulp.dest('dist/'))
.pipe( livereload( server ) );
});
gulp.task('templates', function() {
return gulp.src('src/**/*.jade')
.pipe( jade({ pretty: true }))
.pipe( gulp.dest('dist/'))
.pipe( livereload( server ));
});
gulp.task('express', function() {
app.use(require('connect-livereload')());
app.use(express.static(path.resolve('./dist')));
app.listen(1338);
gutil.log('Listening on port: 1338');
});
gulp.task('watch', function () {
server.listen(35729, function (err) {
if (err) return console.log(err);
});
gulp.watch('src/assets/css/**/*.scss',['sass']);
gulp.watch('src/**/*.coffee',['coffee']);
gulp.watch('./src/**/*.jade',['templates']);
});
// Default Task
gulp.task('default', ['sass','coffee','templates','express','watch']);