Closed Rebugmon closed 11 months ago
中午发布1.13.7后,原有应用构建都报错了,找不到组件 ERR! Module not found: Can't resolve 'xxx/lib/button-l' in '/cloud/source_code/src/config'
ERR! Module not found: Can't resolve 'xxx/lib/button-l' in '/cloud/source_code/src/config'
对比了 1.13.6 和 1.13.7 https://github.com/umijs/babel-plugin-import/compare/v1.13.6...v1.13.7
问题应该是这段驼峰转换的代码逻辑有bug
1.13.6 是正确的:
function transCamel1(_str, symbol) { const str = _str[0].toLowerCase() + _str.substr(1); return str.replace(/([A-Z])/g, $1 => `${symbol}${$1.toLowerCase()}`); } transCamel1('ButtonLN', '-') // 返回 'button-l-n'
1.13.7 不对:
function transCamel2(_str, symbol) { // e.g. QRCode // First match: QR // Second match: Code const cells = _str.match(/([A-Z]+(?=[A-Z]))|([A-Z]?[^A-Z]+)/g) || []; return cells.map(c => c.toLowerCase()).join(symbol); } transCamel2('ButtonLN', '-') // 返回 'button-l'
请先回退 lastest 版本止血,再修复该问题
已通过 dist-tag 回滚。
中午发布1.13.7后,原有应用构建都报错了,找不到组件
ERR! Module not found: Can't resolve 'xxx/lib/button-l' in '/cloud/source_code/src/config'
对比了 1.13.6 和 1.13.7 https://github.com/umijs/babel-plugin-import/compare/v1.13.6...v1.13.7
问题应该是这段驼峰转换的代码逻辑有bug![image](https://github.com/umijs/babel-plugin-import/assets/2455322/94ad5159-8dee-4f1f-ba30-85434a6a6c18)
1.13.6 是正确的:
1.13.7 不对:
请先回退 lastest 版本止血,再修复该问题