-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
57 lines (50 loc) · 1.46 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var csscomb = require('gulp-csscomb');
var nodemon = require('gulp-nodemon');
// var browserSync = require('browser-sync').create();
var input = './client/styles/sass/*.scss';
var output = './client/styles/css/';
// gulp.task('serve', ['sass'], function() {
//
// browserSync.init({
// server: {
// baseDir: "./"
// }
// });
//
// gulp.watch("styles/sass/*.scss", ['sass']).on('change', browserSync.reload);
// gulp.watch("styles/*.css").on("change", browserSync.reload);
// gulp.watch("*.html").on('change', browserSync.reload);
// gulp.watch("portfolio/*.html").on('change', browserSync.reload);
// gulp.watch("scripts/*.js").on('change', browserSync.reload);
// });
gulp.task('node', function() {
nodemon({
script: 'server.js',
ext: 'js html scss',
tasks: ['watch'],
watch: [
'client/*',
'client/styles/sass/*/*'
]
});
});
gulp.task('sass', function() {
return gulp
.src(input)
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer())
.pipe(csscomb())
.pipe(gulp.dest(output));
// .pipe(browserSync.stream());
});
gulp.task('watch', function() {
return gulp
.watch(input, ['sass'])
.on('change', function(event) {
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
});
});
gulp.task('default', ['sass', 'watch', 'node']);