-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (34 loc) · 870 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
var gulp = require('gulp');
var args = process.argv.slice(2);
var target = process.env.TARGET;
if (target == 'run' || args.length > 0) {
global.gulp = gulp;
global.plg = require('gulp-load-plugins')({
pattern: ['gulp-*', 'gulp.*'],
replaceString: /\bgulp[\-.]/
});
require('toml-require').install();
require('babel/register');
require('./gulpfile-es6.js');
}
else
{
var nodemon = require('gulp-nodemon');
var console = require('better-console');
var exec = require('child_process').exec;
gulp.task('default', function (){
exec('which gulp', function (error, stdout, stderr) {
nodemon({
script: stdout.trim(),
watch: ['gulpfile.js', 'gulpfile-es6.js', 'serve.js', 'gulp/*'],
env: {'TARGET': 'run'}
})
.on('start', function() {
console.clear();
})
.on('restart', function() {
console.clear();
});
});
});
}