-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
67 lines (55 loc) · 1.57 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'use strict';
var gulp = require('gulp'),
sass = require('gulp-sass'),
postcss = require('gulp-postcss'),
autoprefixer = require('autoprefixer'),
lost = require('lost'),
livereload = require('gulp-livereload'),
globbing = require('gulp-css-globbing');
var paths = {
modulesSrc: [
'../../modules/mod_ginger_foundation/lib/css/src',
],
cssSource: 'lib/css/src/',
cssDestination: 'lib/css/site/'
};
gulp.task('sass', function () {
gulp.src(paths.cssSource + 'screen.scss')
.pipe(globbing({ extensions: ['.scss'] }))
.pipe(sass({
outputStyle : 'compressed',
errLogToConsole: true
}))
.on('error', sass.logError)
.pipe(postcss([
lost(),
autoprefixer('last 2 versions', 'ie > 7')
]))
.pipe(gulp.dest(paths.cssDestination))
.pipe(livereload());
});
gulp.task('sass:watch', function () {
livereload.listen();
var modules = paths.modulesSrc.map(function(path) {
return path + '/**/*.scss';
});
var watchPaths = [
paths.cssSource + '/**/*.scss'
].concat(modules);
gulp.watch(watchPaths, ['sass']);
});
gulp.task('js', function () {
gulp.src("lib/js/**/*.js").pipe(livereload());
});
gulp.task('js:watch', function () {
livereload.listen();
gulp.watch("lib/js/**/*.js", ['js']);
});
gulp.task('tpl', function () {
gulp.src("/").pipe(livereload());
});
gulp.task('tpl:watch', function () {
livereload.listen();
gulp.watch("templates/**/*.tpl", ['tpl']);
});
gulp.task('default', ['sass', 'sass:watch', 'tpl:watch', 'js:watch']);