replacedefaultLess.js 441 Bytes
Newer Older
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
1 2 3 4 5 6 7 8 9 10 11
const fs = require('fs-extra');

const replacedefaultLess = lessPath => {
  const fileContent = fs.readFileSync(lessPath).toString();
  let lessString = fileContent;
  if (lessString.includes("@import '~antd/lib/style/themes/default.less'")) {
    lessString = lessString.replace("@import '~antd/lib/style/themes/default.less';", '');
  }
  return lessString.replace(/@import '.*\/utils.less';/, '');
};
module.exports = replacedefaultLess;