Skip to content

[Feature] Support native ESM explicitly in package.json #16599

@snake-poison

Description

@snake-poison

What problem does this feature solve?

Looks like the space and standards are moving towards ESM, it'd be cool if this library embraced that by switching to a package.json that embraces the latest best practices in multi-format support.

See:
Additional context about this issue:

What does the proposed API look like?

package.json would include the type and exports options:

  "type": "module",
  "exports": {
    ".": {
      "require": "./dist/echarts.js",
      "import": "./dist/echarts.esm.js",
      "types": "./index.d.ts"
    },
    "./core": {
      "import": "./core.js",
      "types": "./core.d.ts"
    },
    "./renderers": {
      "import": "./renderers.js",
      "types": "./renderers.d.ts"
    },
    "./charts": {
      "import": "./charts.js",
      "types": "./charts.d.ts"
    },
    "./components": {
      "import": "./components.js",
      "types": "./components.d.ts"
    },
     "./features": {
      "import": "./features.js",
      "types": "./features.d.ts"
    }
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    enThis issue is in Englishnew-featurependingWe are not sure about whether this is a bug/new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions