-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
48 lines (41 loc) · 1.22 KB
/
gulpfile.js
File metadata and controls
48 lines (41 loc) · 1.22 KB
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
46
47
48
/*
== Gulp configuration
*/
// Require variables
var gulp = require('gulp');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var autoprefixer = require('gulp-autoprefixer');
// Paths variables
var inputPath = './';
var scssInputPath = inputPath + 'scss/**/**/*.scss';
var cssOutputPath = inputPath + 'css/';
// Compile styles
gulp.task('compilestyles', function () {
return gulp.src([
inputPath + 'scss/style.scss',
inputPath + 'scss/style-high-contrast.scss'
])
.pipe(sass({ // Compile Sass to CSS
errLogToConsole: true,
outputStyle: 'compressed'
}))
// Autoprefix CSS rules
// https://www.npmjs.com/package/gulp-autoprefixer
// https://www.npmjs.com/package/autoprefixer
.pipe(autoprefixer({
browsers: ['last 4 versions', 'IE 11'],
cascade: false
}))
.pipe(gulp.dest(cssOutputPath));
});
// Watching for modifications and compile styles
gulp.task('watch', ['compilestyles'], function () {
// Start watching changes and update page whenever changes are detected
gulp.watch([scssInputPath], ['build']);
});
// Final build
gulp.task('build', [
'compilestyles',
'watch'
]);