-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (30 loc) · 861 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
const gulp = require('gulp');
const sass = require('gulp-sass');
const browserSync = require('browser-sync').create();
const autoprefixer = require('gulp-autoprefixer');
const cssbeautify = require('gulp-cssbeautify');
gulp.task('styles', function () {
gulp.src('./sass/main.sass')
.pipe(sass({ outputStyle: 'compressed' }))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(cssbeautify({
indent: ' ',
autosemicolon: true
}))
.pipe(gulp.dest('./assets/css'))
.pipe(browserSync.reload({stream: true}));
});
gulp.task('serve', function () {
browserSync.init({
server: {
baseDir: './'
}
});
gulp.watch('./sass/*.sass', ['styles']);
gulp.watch('./assets/js/*.js').on('change', browserSync.reload)
gulp.watch('./**/*.html').on('change', browserSync.reload);
});
gulp.task('default', ['styles', 'serve']);