-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (36 loc) · 1.05 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
const gulp = require('gulp');
const sass = require('gulp-sass');
const plumber = require('gulp-plumber');
const browsersync = require('browser-sync');
const autoprefixer = require('gulp-autoprefixer');
const pug = require('gulp-pug');
gulp.task('styles', () => {
return gulp.src('./src/style.scss')
.pipe(plumber())
.pipe(sass({
precision: 7
}))
.pipe(autoprefixer())
.pipe(gulp.dest('./docs'))
.pipe(browsersync.stream())
});
gulp.task('html', () => {
return gulp.src('./src/index.pug')
.pipe(plumber())
.pipe(pug())
.pipe(gulp.dest('./docs'))
.on('end', browsersync.reload)
});
gulp.task('server', (done) => {
browsersync.init({
server: './docs/',
port: 4000,
notify: true
});
gulp.watch('./src/style.scss', {usePolling: true}, gulp.series('styles'));
gulp.watch('./src/index.pug', {usePolling: true}, gulp.series('html'));
done();
});
gulp.task('dev', gulp.series('styles', 'html', 'server'));
gulp.task('build', gulp.series('styles', 'html'));
gulp.task('default', gulp.series('dev'));