-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (38 loc) · 1.15 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
42
43
44
45
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var sassdoc = require('sassdoc');
var input = './src/main/resources/static/scss/**/*.scss';
var output = './src/main/resources/static/css';
var sassOptions = {
errLogToConsole: true,
outputStyle: 'expanded',
dest: './src/main/resources/static/sassdoc'
};
var autoprefixerOptions = {
browsers: ['last 2 versions', '> 5%', 'Firefox ESR']
};
gulp.task('sass', function () {
return gulp
.src(input)
.pipe(sourcemaps.init())
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(autoprefixer(autoprefixerOptions))
.pipe(gulp.dest(output));
});
gulp.task('sassdoc', function () {
return gulp
.src(input)
.pipe(sassdoc())
.resume();
});
gulp.task('watch', function() {
return gulp
.watch(input, ['sass'])
.on('change', function(event) {
console.log('File ' + event.path + ' was changed: ' + event.type);
});
});
gulp.task('default', ['sass', 'watch']);