Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(async resolve => {
await compileServer({ watch: true });
/**
* https://github.com/remy/nodemon/blob/master/doc/requireable.md
*/
nodemon({
script: path.resolve(rootPath, 'start.js'),
watch: serverBuildPath,
// delay: 500,
});
nodemon.once('start', () => {
resolve();
});
/**
* Fix for terminal error
* https://github.com/JacksonGariety/gulp-nodemon/issues/77#issuecomment-277749901
*/
nodemon.on('quit', () => {
process.exit();
});
});
}
process.stdin.on('data', data => {
data = data.toString().trim();
if (data.length === 1 && data.charCodeAt(0) === 113) {
nodemon
.once('exit', () => {
process.exit();
})
.emit('quit');
}
});
} catch (error) {
process.once('SIGINT', () => {
nodemon.once('exit', () => {
logger.info('Exiting Nodemon.');
process.exit();
});
});