color-less.js 806 B

123456789101112131415161718192021222324252627
  1. const path = require('path');
  2. const fs = require('fs');
  3. const bundle = require('less-bundle-promise');
  4. const root = path.resolve(__dirname, '../');
  5. const allLessPath = path.join(root, '_all.less');
  6. const target = path.join(root, 'src/assets/alain-default.less');
  7. const content = `
  8. @import 'node_modules/@delon/theme/styles/index';
  9. @import 'node_modules/@delon/abc/index';
  10. @import 'node_modules/@delon/chart/index';
  11. @import 'node_modules/@delon/theme/styles/layout/default/index';
  12. @import 'node_modules/@delon/theme/styles/layout/fullscreen/index';
  13. @import 'src/styles/index';
  14. @import 'src/styles/theme';
  15. `;
  16. fs.writeFileSync(allLessPath, content);
  17. bundle({
  18. src: allLessPath,
  19. }).then(colorsLess => {
  20. fs.writeFileSync(target, colorsLess);
  21. fs.unlinkSync(allLessPath);
  22. });