-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
59 lines (52 loc) · 1.77 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
// 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));
});
// move bower_components files into the app
gulp.task('copy', function() {
gulp.src([
'bower_components/angular/angular.js',
'bower_components/angular-ui-router/release/angular-ui-router.js',
'bower_components/angular-resource/angular-resource.js',
'bower_components/angular-animate/angular-animate.js',
'bower_components/angular-aria/angular-aria.js',
'bower_components/angular-material/angular-material.js',
'bower_components/ngstorage/ngStorage.js',
'bower_components/webcam/dist/webcam.min.js',
'bower_components/angular-material/angular-material.css'
])
.pipe(gulp.dest( options.COFFEE_DEST + 'libs' ));
});
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', 'copy']);