-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·50 lines (42 loc) · 1.09 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
50
/*!
* Gulpfile Setup
* author: Raúl Hernández <raulghm@gmail.com>
*/
'use strict';
// Include Gulp and other build automation tools and utilities.
// See: https://github.com/gulpjs/gulp/blob/master/docs/API.md
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
var runSequence = require('run-sequence');
// Settings
var SRC = './test/src'; // The source input folder
var DEST = './test/dist/'; // The build output folder
var src = {};
// Clean up
gulp.task('clean', del.bind(null, [DEST]));
// Styles
gulp.task('styles', function () {
src.styles = [SRC + '/**/*.scss'];
return gulp.src(SRC + '/styles.scss')
.pipe($.plumber())
.pipe($.sass({
sourceComments: false,
outputStyle: 'nested',
errLogToConsole: false,
onError: function(err) {
return console.log(err)
}
}))
.pipe(gulp.dest(DEST))
});
// Default task
gulp.task('default', ['build']);
// Build task
gulp.task('build', ['clean'], function (cb) {
runSequence(['styles', 'watch'], cb);
});
// Watch task
gulp.task('watch', function () {
gulp.watch(src.styles, ['styles']);
});