2023-02-13 02:16:46 +01:00
|
|
|
const gulp = require('gulp');
|
|
|
|
const spawn = require('child_process').spawn;
|
|
|
|
|
|
|
|
/*function clean(cb) {
|
|
|
|
cb();
|
|
|
|
}
|
|
|
|
|
|
|
|
function js(cb) {
|
|
|
|
cb();
|
|
|
|
}
|
|
|
|
|
|
|
|
function css(cb) {
|
|
|
|
cb();
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
gulp.task("serve_dev", (cb) => {
|
2023-02-20 03:43:53 +01:00
|
|
|
console.log('Running in dev mode');
|
2023-02-13 02:16:46 +01:00
|
|
|
console.log('Launching node...');
|
|
|
|
let node = spawn('node', ['--inspect=0.0.0.0', 'index.js'], {stdio: 'inherit'})
|
|
|
|
|
|
|
|
function files(cb) {
|
|
|
|
console.log('Restarting node...');
|
|
|
|
node.kill('SIGTERM');
|
|
|
|
node = spawn('node', ['--inspect=0.0.0.0', 'index.js'], {stdio: 'inherit'})
|
|
|
|
cb();
|
|
|
|
}
|
|
|
|
|
|
|
|
gulp.watch("**", { events: 'all' }, files);
|
|
|
|
cb();
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task("serve", (cb) => {
|
|
|
|
console.log('Launching node...');
|
2023-02-18 14:41:24 +01:00
|
|
|
spawn('node', ['index.js'], {stdio: 'inherit'})
|
2023-02-13 02:16:46 +01:00
|
|
|
cb();
|
|
|
|
});
|
|
|
|
|
|
|
|
exports.default = function() {
|
|
|
|
gulp.watch("**", files);
|
|
|
|
}
|