diff --git a/package.README.md b/package.README.md index 0b51fbc9bd..0960ecbbd9 100644 --- a/package.README.md +++ b/package.README.md @@ -1,7 +1,8 @@ # NOTICE about package.json -See more details about in the "exports" field of `package.json` and why it is written like that in https://github.com/apache/echarts/pull/19513 . +**[[!Remember!]]**: update the "exports" field of `package.json` if adding new public entry files. +See more details about in the "exports" field of `package.json` and why it is written like that in https://github.com/apache/echarts/pull/19513 . ## Public and private @@ -30,6 +31,8 @@ The other entries listed in the `"exports"` field of `package.json` make the int Since `v5.5.0`, `"type": "module"` and `"exports: {...}"` are added to `package.json`. When upgrading to `v5.5.0+`, if you meet some problems about "can not find/resolve xxx" when importing `echarts/i18n/xxx` or `echarts/theme/xxx` or some internal files, it probably because of the issue "file extension not fully specified". Please try to make the file extension fully specified (that is, `import 'xxx/xxx/xxx.js'` rather than `import 'xxx/xxx/xxx'`), or change the config of you bundler tools to support auto adding file extensions. +About `"./types/dist/shared": "./types/dist/shared.d.ts",` in "exports", see https://github.com/apache/echarts/pull/19663 . + ## Use physical entry file or alias in `"exports"` of `package.json` diff --git a/package.json b/package.json index 3b4dd0fe3f..6b25aab43b 100644 --- a/package.json +++ b/package.json @@ -129,6 +129,14 @@ "./index.js": "./index.js", "./theme/*": "./theme/*", "./i18n/*": "./i18n/*", + "./types/dist/charts": "./types/dist/charts.d.ts", + "./types/dist/components": "./types/dist/components.d.ts", + "./types/dist/core": "./types/dist/core.d.ts", + "./types/dist/echarts": "./types/dist/echarts.d.ts", + "./types/dist/features": "./types/dist/features.d.ts", + "./types/dist/option": "./types/dist/option.d.ts", + "./types/dist/renderers": "./types/dist/renderers.d.ts", + "./types/dist/shared": "./types/dist/shared.d.ts", "./ssr/client/index": { "types": "./ssr/client/index.d.ts", "import": "./ssr/client/index.js",