index.ts 680 B

12345678910111213141516171819202122
  1. import program from 'commander';
  2. import { startTask } from './start';
  3. import chalk from 'chalk';
  4. program
  5. .option('-h, --hot', 'Runs front-end with hot reload enabled')
  6. .option('-t, --theme', 'Watches for theme changes and regenerates variables.scss files')
  7. .option('-d, --depreciate <scripts>', 'Inform about npm script deprecation', v => v.split(','))
  8. .parse(process.argv);
  9. if (program.depreciate && program.depreciate.length === 2) {
  10. console.log(
  11. chalk.yellow.bold(
  12. `[NPM script depreciation] ${program.depreciate[0]} is deprecated! Use ${program.depreciate[1]} instead!`
  13. )
  14. );
  15. }
  16. startTask({
  17. watchThemes: !!program.theme,
  18. hot: !!program.hot,
  19. });