theme.js 607 B

1234567891011121314151617
  1. const path = require('path');
  2. const { generateTheme } = require('antd-theme-generator');
  3. const options = {
  4. antDir: path.join(__dirname, './node_modules/antd'),
  5. stylesDir: path.join(__dirname, './src/style/antd'),
  6. varFile: path.join(__dirname, './src/style/antd/variables.less'),
  7. mainLessFile: path.join(__dirname, './src/style/antd/index.less'),
  8. indexFileName: 'index.html',
  9. outputFilePath: path.join(__dirname, './public/theme.less'),
  10. }
  11. generateTheme(options).then(less => {
  12. console.log('Theme generated successfully');
  13. }).catch(error => {
  14. console.log('Error', error);
  15. });