// let argvs = JSON.parse(process.env.npm_config_argv);
// let remain = argvs.remain;
let cmd = process.argv[2];

const DBGBuild = require('duiba-game-build');
const config = require('./.buildrc');
let build = new DBGBuild(config);

if (cmd === 'build' && process.argv[3] === 'prod') {
  // if (cmd === 'build' && remain[1] === 'prod') {
  cmd = 'buildProd';
  if (process.argv[4] === 'ts')
    cmd = 'buildProdTS';
  if (process.argv[4] === 'exml')
    cmd = 'buildProdEXML';
}
build[cmd]('egret');