Skip to content

@antv/l7-component ES build imports .less source files since v2.24.0, requiring consumers to install less preprocessor #2844

Description

@renis-cardoai

Description:

Starting in v2.24.0, @antv/l7-component/es/index.js has an
active .less import:

import "./css/index.less";

In v2.23.x and earlier, this was commented out:

// import './css/index.less';

This breaks builds for any project that depends on @antv/l7
transitively (e.g. via @ant-design/maps or
@ant-design/charts) without having less installed as a dev
dependency.

Error: Preprocessor dependency "less" not found. Did you
install it?

Expected behavior:
Published ES module builds should ship compiled CSS
(index.css), not preprocessor source files. Consumers should
not need to install less to use this package.

Reproduction:

  1. Install @ant-design/charts (which pulls @ant-design/maps →
    @antv/l7 → @antv/l7-component)
  2. Build with Vite (or any bundler) without less installed
  3. Build fails on @antv/l7-component/es/css/index.less

Workaround:
Pin @antv/l7 and @antv/l7-component to 2.23.2 via yarn/npm
resolutions.

Versions affected: 2.24.0 – 2.25.4 (latest)

Metadata

Metadata

Assignees

Labels

bug这个是一个 bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions