build-all.js 612 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. const components = require('../components.json');
  3. const execSync = require('child_process').execSync;
  4. const existsSync = require('fs').existsSync;
  5. const path = require('path');
  6. let componentPaths = [];
  7. delete components.index;
  8. delete components.font;
  9. Object.keys(components).forEach(key => {
  10. const filePath = path.join(__dirname, `../packages/${key}/cooking.conf.js`);
  11. if (existsSync(filePath)) {
  12. componentPaths.push(`packages/${key}/cooking.conf.js`)
  13. }
  14. });
  15. const paths = componentPaths.join(',');
  16. const cli = `cooking build -c ${paths} -p`;
  17. execSync(cli, {
  18. stdio: 'inherit'
  19. });