-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·39 lines (32 loc) · 1.11 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
'use strict';
// Includes packages
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
postcss = require('gulp-postcss'),
cleanCss = require('gulp-clean-css'),
notify = require('gulp-notify');
// Paths variables
var paths = {
dist : 'dist',
docs : 'docs',
distCSS : './dist/style.css',
graphDir : 'specificity-graph',
sass : ['src/**/*.scss' ]
};
// Compile SASS
gulp.task('sass', function () {
return gulp.src(paths.sass)
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({browsers: ['IE 8', 'IE 9', 'last 5 versions']}))
.pipe(cleanCss())
.pipe(gulp.dest(paths.dist))
.pipe(gulp.dest(paths.docs))
.pipe(notify({ title: 'SASS', message: 'Compiled successfully!! Happy coding! 😎', onLast: true}));
});
// Rerun the task when a file changes
gulp.task('watch', function() {
gulp.watch(paths.sass, ['sass']);
});
// Run default task
gulp.task('default', ['sass', 'watch']);