-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (42 loc) · 1.31 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
46
47
48
49
'use strict';
var gulp = require('gulp-help')(require('gulp'));
// Plugins.
var gutil = require('gulp-util');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var sass = require('gulp-sass');
var sassPath = './scss/**/*.scss';
gulp.task('scss', 'Process SCSS using libsass',
function () {
var includePaths = [
'node_modules/compass-mixins/lib'
];
// Reference version of compiled files.
// These can be used for debugging or determining changes.
gulp.src(sassPath)
.pipe(sass({
// The nested output style is the most verbose one.
outputStyle: 'nested',
includePaths: includePaths
}).on('error', sass.logError))
.pipe(gulp.dest('./css'));
// Production version of compiled files. These are used by default.
gulp.src(sassPath)
.pipe(sass({
outputStyle: 'compressed',
includePaths: includePaths
}).on('error', sass.logError))
// Add a .min to compiled files to separate them from the verbose set.
.pipe(rename(function (path) {
path.extname = '.min.css';
}))
.pipe(gulp.dest('./css'));
}
);
gulp.task('watch', 'Watch and process JS and SCSS files', [ 'scss'],
function() {
gulp.watch(sassPath, ['scss']);
}
);
gulp.task('default');