-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (28 loc) · 903 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
const gulp = require('gulp');
const childProcess = require('child_process');
const electron = require('electron-prebuilt');
const babel = require('gulp-babel');
const less = require('gulp-less');
const path = require('path');
const clean = require('gulp-clean');
gulp.task('default', function() { });
gulp.task('run', ['scripts', 'less'], function () {
childProcess.spawn(electron, ['.'], { stdio: 'inherit' });
});
gulp.task('scripts', ['clean'], () => {
return gulp.src('app/**/*.js')
.pipe(babel())
.pipe(gulp.dest('dist'));
});
gulp.task('less', ['clean'], function () {
return gulp.src('./app/**/*.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(gulp.dest('./dist'));
});
gulp.task('clean', function () {
return gulp.src('dist', { read: false })
.pipe(clean());
});
gulp.watch('app/**/*', ['clean', 'scripts', 'less']);