-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
59 lines (53 loc) · 1.36 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
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
plumber = require('gulp-plumber'),
livereload = require('gulp-livereload'),
sass = require('gulp-sass'),
sourcemaps = require("gulp-sourcemaps"),
babel = require("gulp-babel"),
browserify = require("gulp-browserify"),
concat = require("gulp-concat");
gulp.task('sass', function () {
gulp.src('./public/css/*.scss')
.pipe(plumber())
.pipe(sass())
.pipe(gulp.dest('./public/css'))
.pipe(livereload());
});
gulp.task('watch', function() {
// gulp.watch('./public/css/*.scss', ['sass']);
gulp.watch('/public/js/src/*.js', ['js']);
});
// gulp.task("js", function () {
// return gulp.src("./public/js/src/*.js")
// .pipe(sourcemaps.init())
// .pipe(watch())
// .pipe(concat("all.js"))
// .pipe(babel())
// .pipe(sourcemaps.write("."))
// .pipe(gulp.dest("./public/js/"));
// });
gulp.task("js", function () {
gulp.src('./public/js/src/*.js')
.pipe(browserify({
insertGlobals : true,
debug : true
}))
.pipe(gulp.dest('./public/js/'));
});
gulp.task('develop', function () {
livereload.listen();
nodemon({
script: 'app.js',
ext: 'js jade',
}).on('restart', function () {
setTimeout(function () {
livereload.changed(__dirname);
}, 500);
});
});
gulp.task('default', [
'sass',
'develop',
'watch'
]);