start.ts 857 B

1234567891011121314151617181920212223242526272829303132
  1. import concurrently from 'concurrently';
  2. export const startTask = async ({ watchThemes, hot }: { watchThemes: boolean; hot: boolean }) => {
  3. const jobs = [];
  4. if (watchThemes) {
  5. jobs.push({
  6. command: 'nodemon -e ts -w ./packages/grafana-ui/src/themes -x yarn run themes:generate',
  7. name: 'SASS variables generator',
  8. });
  9. }
  10. if (!hot) {
  11. jobs.push({
  12. command: 'webpack --progress --colors --watch --mode development --config scripts/webpack/webpack.dev.js',
  13. name: 'Webpack',
  14. });
  15. } else {
  16. jobs.push({
  17. command: 'webpack-dev-server --progress --colors --mode development --config scripts/webpack/webpack.hot.js',
  18. name: 'Dev server',
  19. });
  20. }
  21. try {
  22. await concurrently(jobs, {
  23. killOthers: ['failure', 'failure'],
  24. });
  25. } catch (e) {
  26. console.error(e);
  27. process.exit(1);
  28. }
  29. };