-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (35 loc) · 953 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
38
39
40
'use strict';
const gulp = require('gulp'),
sass = require('gulp-sass'),
watch = require('gulp-watch'),
autoprefixer = require('gulp-autoprefixer'),
browserSync = require('browser-sync').create(),
runSequence = require('run-sequence');
gulp.task('scss', () =>
gulp.src('css/styles.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions']
}))
.pipe(gulp.dest('css'))
);
gulp.task('watch', ['browser-sync-init', 'scss'], () =>
watch('css/*.scss', () => runSequence('scss'))
);
gulp.task('browser-sync-init', done => {
browserSync.init({
ghostMode: false,
files: [
'*.html',
'css/*.css',
'js/*.js'
],
open: true,
server: {
baseDir: './',
middleware: {}
},
port: 8080
}, done);
});
gulp.task('default', ['scss']);