-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
37 lines (30 loc) · 834 Bytes
/
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
'use strict';
const gulp = require('gulp');
const electron = require('electron-connect').server.create({
verbose: true
});
gulp.task('dev', () => {
// Start browser process
electron.start();
// Restart browser process
gulp.watch('app/main/*.js', ['restart:browser']);
// Reload renderer process
gulp.watch('app/renderer/css/*.css', ['reload:renderer']);
gulp.watch('app/renderer/*.html', ['reload:renderer']);
gulp.watch('app/renderer/js/*.js', ['reload:renderer']);
});
gulp.task('restart:browser', done => {
electron.stop();
electron.restart();
done();
});
gulp.task('reload:renderer', done => {
// Reload renderer process
electron.reload();
done();
});
// Test app using mocha+spectron
gulp.task('test', () => {
return gulp.src('tests/index.js').pipe(mocha());
});
gulp.task('default', ['dev', 'test']);