-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgulpfile.js
More file actions
40 lines (34 loc) · 958 Bytes
/
gulpfile.js
File metadata and controls
40 lines (34 loc) · 958 Bytes
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
var gulp = require('gulp');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
var styl = require('gulp-styl');
var refresh = require('gulp-livereload');
var lr = require('tiny-lr');
var server = lr();
gulp.task('scripts', function() {
gulp.src(['js/**/*.js'])
.pipe(browserify())
.pipe(concat('dest.js'))
.pipe(gulp.dest('build'))
.pipe(refresh(server))
})
gulp.task('styles', function() {
gulp.src(['css/**/*.css'])
.pipe(styl({
compress: true
}))
.pipe(gulp.dest('build'))
.pipe(refresh(server))
})
gulp.task('lr-server', function() {
server.listen(35729, function(err) {
if (err) return console.log(err);
gulp.watch(['js/**/*.js', '*.html', 'css/**/*.css'], function(event) {
gulp.src('index.html').pipe(refresh(server))
})
});
})
gulp.task('build', ['lr-server', 'scripts', 'styles'], function() {
})
gulp.task('default', ['lr-server'], function() {
})