-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
40 lines (37 loc) · 1.16 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var rename = require('gulp-rename');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var watch = require('gulp-watch');
// Compile the CSS and other tricks from the dark arts.
gulp.task('sass', function () {
"use strict";
return gulp.src('./sass/{,*/}*.{scss,sass}')
.pipe(sourcemaps.init())
.pipe(sass({
errLogToConsole: true
}))
.pipe(postcss([autoprefixer()]))
.pipe(sourcemaps.write())
.pipe(rename('style.css'))
.pipe(gulp.dest('./css')),
gulp.src('./sass/bootstrap/{,*/}*.{scss,sass}')
.pipe(sourcemaps.init())
.pipe(sass({
errLogToConsole: true
}))
.pipe(postcss([autoprefixer()]))
.pipe(sourcemaps.write())
.pipe(rename('bootstrap.css'))
.pipe(gulp.dest('./css'));
});
// Watch for Sass file changes.
gulp.task('watch', function () {
"use strict";
return gulp.watch('./sass/{,**/}*.{scss,sass}', gulp.series('sass'))
});
// Default task.
// Ensure the CSS is compiled and then watch for file changes.
gulp.task('default', gulp.series('sass', 'watch'));