-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (39 loc) · 1.09 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
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const concat = require('gulp-concat');
const del = require('del');
const browserSync = require('browser-sync').create('sync');
const reload = browserSync.reload;
const csscomb = require('gulp-csscomb');
gulp.task('styles', function() {
gulp.src('src/sass/**/*.scss')
.pipe(csscomb())
.pipe(sass())
.pipe(concat("./styles.css"))
.pipe(gulp.dest('public'))
.pipe(reload({stream:true}))
});
gulp.task('html', function(){
gulp.src('src/index.html')
.pipe(gulp.dest('public'))
.pipe(reload({stream:true}))
});
gulp.task('clean', function(){
return del('public');
});
gulp.task('build', ['clean', 'styles', 'html', 'browserSync']);
gulp.task('browserSync', function() {
browserSync.init({
ui: false,
notify: false,
server: {
baseDir: 'public',
directory: true
}
});
});
gulp.task('default', ['build'], function() {
gulp.watch('src/sass/**/*.scss',['styles']);
gulp.watch('src/*.html', ['html']);
});