-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
31 lines (27 loc) · 937 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
notify = require('gulp-notify'),
multipipe = require('multipipe'),
sourcemaps = require('gulp-sourcemaps'),
browserSync = require('browser-sync').create();
gulp.task('sass', function() {
return multipipe(
gulp.src('styles/sass/style.scss'),
sourcemaps.init(),
sass(),
autoprefixer('last 2 versions', 'safari 5', 'ie6', 'ie7', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'),
sourcemaps.write('.'),
gulp.dest('styles/css')
).on('error', notify.onError());
});
gulp.task('server', function () {
browserSync.init({
server: '.'
});
browserSync.watch(['styles/css/*.css', 'index.html']).on('change', browserSync.reload);
});
gulp.task('watch:sass', function() {
gulp.watch('styles/sass/**/*.scss', gulp.series('sass'));
});
gulp.task('dev', gulp.parallel('watch:sass', 'server'));