getLocalIdentName.js 275 B

12345678
  1. module.exports = path => {
  2. const antdProPath = path.match(/src(.*)/)[1].replace('.less', '');
  3. const arr = antdProPath
  4. .split('/')
  5. .map(a => a.replace(/([A-Z])/g, '-$1'))
  6. .map(a => a.toLowerCase());
  7. return `antd-pro${arr.join('-')}-`.replace(/--/g, '-');
  8. };