-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (37 loc) · 1.32 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
var gulp = require('gulp');
var jade = require('gulp-jade');
var copy = require('gulp-copy');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var livereload = require('gulp-livereload');
//////////WATCH////////////////////////////////////
gulp.task('watch', function () {
livereload.listen();
watch('./app/**/*', function() {
gulp.start('build');
});
});
//////////SASS////////////////////////////////////
gulp.task('sass', function () {
gulp.src('./app/**/*.scss')
.pipe(sass())
.on('error', console.error.bind(console))
.pipe(gulp.dest('./public/'))
.pipe(livereload());
});
//////////COPY////////////////////////////////////
gulp.task('copy', function () {
gulp.src(['./app/**/*.js', './app/**/*.jpg', './app/**/*.jpeg', './app/**/*.png', './app/**/*.gif', './app/**/*.mp4', './app/**/*.json', './app/**/*.ico', './app/**/*.svg'])
.pipe(copy('./public/', {prefix:1}))
});
//////////JADE////////////////////////////////////
gulp.task('jade', function() {
gulp.src('./app/**/*.jade')
.pipe(jade({pretty: true, doctype: 'html'}))
.on('error', console.error.bind(console))
.pipe(gulp.dest('./public/'))
.pipe(livereload({start: true}));
});
//////////DEFAULT////////////////////////////////////
gulp.task('build', ['copy', 'jade', 'sass']);
gulp.task('default', ['build', 'watch']);