forked from nightwolf93/Electron-Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
43 lines (40 loc) · 1.25 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
var gulp = require('gulp'),
watch = require('gulp-watch'),
less = require('gulp-less'),
path = require('path'),
coffee = require('gulp-coffee'),
plumber = require('gulp-plumber'),
concat = require('gulp-concat');
var handlebars = require('gulp-handlebars');
var wrap = require('gulp-wrap');
var declare = require('gulp-declare');
gulp.task('watch', function (cb) {
watch('less/**/*.less', function () {
gulp.src('less/**/*.less')
.pipe(plumber())
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(concat('style.css'))
.pipe(gulp.dest('./css'));
});
watch('coffee/**/*.coffee', function () {
gulp.src('coffee/**/*.coffee')
.pipe(plumber())
.pipe(coffee())
.pipe(concat('all.js'))
.pipe(gulp.dest('./js'));
});
watch('templates/**/*.hbs', function () {
gulp.src('templates/**/*.hbs')
.pipe(plumber())
.pipe(handlebars())
.pipe(wrap('Handlebars.template(<%= contents %>)'))
.pipe(declare({
namespace: 'Templates',
noRedeclare: true, // Avoid duplicate declarations
}))
.pipe(concat('templates.js'))
.pipe(gulp.dest('./js'));
});
});