fix: comment out .less import to avoid requiring less preprocessor#2851
fix: comment out .less import to avoid requiring less preprocessor#2851lzxue wants to merge 1 commit into
Conversation
Fixes #2844 Since v2.24.0, @antv/l7-component/es/index.js imports .less source files, breaking builds for projects that depend on @antv/l7 transitively without having less installed as a dev dependency. This fix comments out the less import to restore v2.23.x behavior.
|
There was a problem hiding this comment.
Code Review
This pull request comments out the LESS style import in packages/component/src/index.ts to prevent consumers from being forced to install the LESS preprocessor. The reviewer suggests removing the commented-out code entirely to avoid zombie code and replacing it with a descriptive comment explaining that styles must be imported manually.
| import './assets/iconfont/iconfont.js'; | ||
| // 引入样式 | ||
| import './css/index.less'; | ||
| // import './css/index.less'; /* 注释掉以避免消费者必须安装 less */ |
描述
修复 Issue #2844
问题
自 v2.24.0 起,
@antv/l7-component/es/index.js导入了 .less 源文件:这会导致通过传递依赖(如 @ant-design/maps 或 @ant-design/charts)依赖 @antv/l7 的项目,在没有安装 less 作为开发依赖时构建失败。
修改内容
packages/component/src/index.ts: 注释掉.less导入,恢复 v2.23.x 的行为测试
Closes #2844
🤖 Generated with Claude Code