-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
28 lines (24 loc) · 724 Bytes
/
gulpfile.js
File metadata and controls
28 lines (24 loc) · 724 Bytes
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
var gulp = require('gulp'),
sass = require('gulp-sass'),
csso = require('gulp-csso'),
rename = require('gulp-rename');
var sassConfig = {
inputDirectory: 'src/*.scss',
outputDirectory: 'dist',
options: {
outputStyle: 'expanded'
}
};
gulp.task('default', ['build-css']);
gulp.task('build-css', function() {
return gulp
.src(sassConfig.inputDirectory)
.pipe(sass(sassConfig.options).on('error', sass.logError))
.pipe(gulp.dest(sassConfig.outputDirectory))
.pipe(rename({ suffix: '.min' }))
.pipe(csso())
.pipe(gulp.dest(sassConfig.outputDirectory));
});
gulp.task('watch', function() {
gulp.watch('src/*.scss', ['build-css']);
});