How to use the umi-build-dev/lib/Service.default 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 / realDev.js View on Github external
// kill(3) Ctrl-\
process.once('SIGQUIT', () => onSignal('SIGQUIT'));
// kill(15) default
process.once('SIGTERM', () => onSignal('SIGTERM'));

function onSignal() {
  if (closed) return;
  closed = true;
  process.exit(0);
}

process.env.NODE_ENV = 'development';

const args = yParser(process.argv.slice(2));
const Service = require('umi-build-dev/lib/Service').default;
new Service(buildDevOpts(args)).run('dev', args);
github umijs / umi / packages / umi / src / cli.js View on Github external
'--help': 'help',
};

spinner.succeed();

switch (script) {
  case 'build':
  case 'dev':
  case 'test':
  case 'inspect':
    // eslint-disable-next-line import/no-dynamic-require
    require(`./scripts/${script}`);
    break;
  default: {
    const Service = require('umi-build-dev/lib/Service').default;
    new Service(buildDevOpts(args)).run(aliasMap[script] || script, args);
    break;
  }
}
github umijs / umi / packages / umi / src / cli.js View on Github external
'-h': 'help',
  '--help': 'help',
};

switch (script) {
  case 'build':
  case 'dev':
  case 'test':
  case 'inspect':
  case 'ui':
    // eslint-disable-next-line import/no-dynamic-require
    require(`./scripts/${script}`);
    break;
  default: {
    const Service = require('umi-build-dev/lib/Service').default;
    new Service(buildDevOpts(args)).run(aliasMap[script] || script, args);
    break;
  }
}
github umijs / umi / packages / umi / src / scripts / build.js View on Github external
import yParser from 'yargs-parser';
import buildDevOpts from '../buildDevOpts';

process.env.NODE_ENV = 'production';
process.env.UMI_UI = 'none';

const args = yParser(process.argv.slice(2));
const Service = require('umi-build-dev/lib/Service').default;
new Service(buildDevOpts(args)).run('build', args);