How to use the umi-build-dev/lib/fork function in umi-build-dev

To help you get started, we’ve selected a few umi-build-dev examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github umijs / umi / packages / umi / src / scripts / dev.js View on Github external
import fork from 'umi-build-dev/lib/fork';

const child = fork(require.resolve('./realDev.js'));
child.on('message', data => {
  if (process.send) {
    process.send(data);
  }
});
child.on('exit', code => {
  if (code === 1) {
    process.exit(1);
  }
});

process.on('SIGINT', () => {
  child.kill('SIGINT');
});