-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (30 loc) · 909 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
var gulp = require('gulp');
// CSS
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var minifyCSS = require('gulp-csso');
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var notify = require('gulp-notify');
var path = "src/";
gulp.task('sass', function() {
return gulp.src(path+'sass/**')
// .pipe(sourcemaps.init())
.pipe(sass({ outputStyle: 'expanded' }))
.on('error', notify.onError())
.pipe(autoprefixer({
browsers: ['last 4 versions']
}))
.pipe(minifyCSS())
// .pipe(sourcemaps.write())
.pipe(gulp.dest('dist/css'))
.pipe(browserSync.stream({ match: '**/*.css' }));
});
gulp.task('default', gulp.parallel("sass", function(done) {
browserSync.init({
proxy: "localhost:8080",
notify: true
});
gulp.watch(path+'sass/**', gulp.parallel('sass'));
done();
}));