Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
webpackCompiler.hooks.done.tap('kyt', stats => {
if (stats.hasErrors()) {
logger.error(`${type} build failed\n`, stats.toString());
logger.info('See webpack error above');
} else if (stats.hasWarnings()) {
logger.warn(`${type} build warnings`, stats.toJson().warnings.join('\n'));
} else {
logger.task(`${type} build successful`);
}
// Remove the build type that we set in the "before-run" hook.
delete process.env.KYT_ENV_TYPE;
// Call the callback on successful build
if (cb) {
cb(stats);
}
});
process.on('SIGINT', () => {
logger.warn('kyt interrupted ☝️');
process.exit(0);
});