-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (29 loc) · 966 Bytes
/
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
'use strict'
let gulp = require('gulp')
let sass = require('gulp-sass')
let browserSync = require('browser-sync').create()
let inputPath = './style'
let outputPath = './style'
// Compile sass files
gulp.task('build', () => {
gulp.src(`${inputPath}/**/*.{scss,sass}`)
.pipe(sass({
outputStyle: 'expanded' // nested, expanded, compact, compressed
})).on('error', sass.logError)
.pipe(gulp.dest(outputPath))
.pipe(browserSync.stream())
})
// Watch sass files
gulp.task('watch', () => {
gulp.watch(`${inputPath}/**/*.{scss,sass}`, ['build'])
})
// Static server and watching scss files
gulp.task('serve:sass', ['build'], () => {
browserSync.init();
gulp.watch(`${inputPath}/**/*.{scss,sass}`, ['build'])
});
// Static server and watching scss, html, php and yaml files
gulp.task('serve', ['serve:sass'], () => {
gulp.watch("**/*.{php,html,htm,yaml,yml}").on('change', browserSync.reload)
});
gulp.task('default', ['serve'])