-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
35 lines (31 loc) · 877 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
var npmPackage = require('./package.json');
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
gulp.task('css', function () {
return gulp.src('sass/**/*.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(postcss([
autoprefixer()
]))
.pipe(gulp.dest('css'))
.pipe(browserSync.stream());
});
gulp.task('serve', ['css'], function () {
browserSync.init({
server: {
baseDir: './'
},
port: 8000,
logPrefix: npmPackage.name,
logConnections: true,
notify: false,
reloadOnRestart: true
});
gulp.watch('sass/**/*.scss', ['css']);
gulp.watch(['./img/**', './index.html', './js/**'])
.on('change', browserSync.reload);
});
gulp.task('default', ['serve']);