Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
running = true;
nodemon({
execMap: {
js: 'node'
},
script: path.join(__dirname, 'build', 'backend'),
ignore: ['*'],
watch: ['foo/'],
ext: 'noop'
});
}
// There's a trick here. Restart will just send SIGUSR2 to our process.
// src/signal.js will intercept it and handle hot update instead of restarting.
nodemon.restart();
});
).on('end', function() {
nodemon.restart();
cb();
});
});
serverCompiler.plugin('done', function () {
log.info('webpack', 'Bundled server in ' + (Date.now() - bundleStart) + 'ms!')
if (startedServer) {
nodemon.restart()
} else {
startedServer = true
startServer()
registerRefreshListener()
}
})
webpack(config).watch(100, () => {
if (runner) {
log(chalk.gray('Restarting...'))
nodemon.restart()
} else {
starter.succeed('Built!')
runner = run()
}
})
apiCompiler.plugin('done', function (stats) {
if (!canContinue('server-api', false, stats)) return
log.info('webpack', 'Bundled server-api in ' + (Date.now() - bundleClientStart) + 'ms!')
if (startedServer) {
nodemon.restart()
} else {
nodemon({
execMap: {
js: 'node',
},
script: path.join(__dirname, '..', '..', 'build', 'api', 'server-api.js'),
ignore: ['*'],
watch: ['nothing/'],
ext: 'noop',
})
nodemon
.on('quit', () => log.info('nodemon', 'server-api: stopped server. bye'))
.on('exit', () => log.info('nodemon', 'server-api: nodemon exited'))
.on('crash', () => log.info('nodemon', 'server-api: nodemon crashed'))
.on('stderr', () => log.info('nodemon', 'server-api: nodemon stderr'))
webpack(config).watch(100, () => {
if (runner) {
log(chalk.gray('Restarting...'))
nodemon.restart()
} else {
starter.succeed('Built!')
runner = run()
}
})
} else {
webpack(serverDev).watch(100, function (err, stats) {
onBuild()(err, stats)
if (running) {
nodemon.restart()
}
})
})
webpack(backendConfig).watch(100, function(err, stats) {
if(!firedDone) {
firedDone = true;
done();
}
nodemon.restart();
});
});
.switchMap(({ status }) => {
if (status === 'done') {
nodemon.restart();
return nodemonStart$
.first()
.flatMap(() => waitForPort(appPort, appHost))
.map(() => true);
}
return [false];
})
.distinctUntilChanged();
onChange: () => {
nodemon.restart()
}
}))