-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
32 lines (27 loc) Β· 843 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
const gulp = require('gulp');
const { watch } = require('gulp');
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');
const browserSync = require("browser-sync").create();
function reload() {
browserSync.reload();
}
function styles() {
return gulp.src('scss/styles.scss')
.pipe(sass({ includePaths: ['./node_modules/normalize-scss/sass'], outputStyle: 'compressed'})
.on('error', sass.logError))
.pipe(autoprefixer({browsers: ['last 2 versions']}))
.pipe(gulp.dest('css/'))
.pipe(browserSync.stream());
}
function watchFiles() {
browserSync.init({
server: {
baseDir: "./"
}
});
watch(['scss/**/*.scss'], styles, reload);
watch(['index.html'], reload);
}
exports.styles = styles;
exports.watch = watchFiles;