-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (37 loc) · 1.14 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
// get the dependencies
var gulp = require('gulp'),
childProcess = require('child_process'),
electron = require('electron');
var coffee = require('gulp-coffee'),
concat = require('gulp-concat'),
gutil = require('gulp-util'),
changed = require('gulp-changed'),
livereload = require('gulp-livereload'),
lr = require('tiny-lr'),
server = lr();
var options = {
COFFEE_SOURCE: "app/scripts/**/*.coffee",
COFFEE_DEST: "app/assets/js/",
};
// create the gulp task
gulp.task('run', function() {
childProcess.spawn(electron, ['--debug=5858', './app'], { stdio: 'inherit' });
});
// Transpile coffee to JavaScript
gulp.task('coffee', function() {
gulp.src(options.COFFEE_SOURCE)
.pipe(changed(options.COFFEE_SOURCE))
.pipe(coffee())
.pipe(gulp.dest(options.COFFEE_DEST))
.on('error', gutil.log)
.pipe(livereload(server));
});
gulp.task('watch', function() {
server.listen(options.LIVE_RELOAD_PORT, function(err) {
if (err) {
return console.log(err)
};
gulp.watch(options.COFFEE_SOURCE, ['coffee']);
});
});
gulp.task('build', ['coffee']);