-
Notifications
You must be signed in to change notification settings - Fork 65
/
gulpfile.js
41 lines (38 loc) · 1.22 KB
/
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
41
const gulp = require('gulp');
const browserSync = require('browser-sync').create();
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');
const sourcemaps = require('gulp-sourcemaps');
const rename = require('gulp-rename');
gulp.task('serve', function () {
browserSync.init({
server: './'
});
gulp.watch('./src/scss/**/*.scss', gulp.series('sass'));
gulp.watch('./**/*.html').on('change', browserSync.reload);
});
gulp.task('sass', function () {
return gulp.src('src/scss/mustard-ui.scss')
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: [
'Last 2 Chrome versions',
'Last 2 Edge versions',
'Last 2 Firefox versions',
'Last 2 Safari versions',
'Last 3 iOS versions',
'IE 11'
],
cascade: false
}))
.pipe(rename({
suffix: '.min'
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist/css/'))
.pipe(browserSync.stream());
});
gulp.task('default', gulp.series('serve', 'sass'));