Skip to content

Commit 6b98318

Browse files
committed
build: add back umd, drop csp, share type between vue2/3
1 parent 27c79b9 commit 6b98318

14 files changed

+318
-414
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
### Breaking changes
44

5-
* Dropped browsers without `ResizeObserver` support. Can work with [resize-observer-polyfill](https://www.npmjs.com/package/resize-observer-polyfill).
5+
* Dropped support for browsers without `ResizeObserver`. Can work with [resize-observer-polyfill](https://www.npmjs.com/package/resize-observer-polyfill).
66
* Dropped support for Vue < 2.7.
7+
* Dropped CJS outputs.
78

89
## 6.7.3
910

README.md

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,16 @@
1515

1616
<h2>💡 Heads up 💡 <a href="./README.zh-Hans.md"><img src="https://img.shields.io/badge/%E4%B8%AD%E6%96%87%E7%89%88-20c3aa" alt="前往中文版" align="right" height="24"/></a></h2>
1717

18-
If you are migrating from `vue-echarts` ≤ 5, you should read the _[Migration to v6](#migration-to-v6)_ section before you update to v6.
19-
20-
Not ready yet? Read documentation for older versions [here →](https://github.com/ecomfe/vue-echarts/tree/5.x)
18+
Still using v6? Read v6 docs [here →](https://github.com/ecomfe/vue-echarts/tree/6.x)
2119

2220
## Installation & Usage
2321

24-
### npm & ESM
25-
26-
```sh
27-
npm i echarts vue-echarts
28-
```
29-
30-
To make `vue-echarts` work for _Vue 2_ (<2.7.0), you need to have `@vue/composition-api` installed (`@vue/runtime-core` for TypeScript support):
22+
### npm
3123

3224
```sh
33-
npm i @vue/composition-api
34-
npm i @vue/runtime-core # for TypeScript support
25+
npm add echarts vue-echarts
3526
```
3627

37-
If you are using _NuxtJS_ on top of _Vue 2_, you'll need `@nuxtjs/composition-api`:
38-
39-
```sh
40-
npm i @nuxtjs/composition-api
41-
```
42-
43-
And then add `'@nuxtjs/composition-api/module'` in the `buildModules` option in your `nuxt.config.js`.
44-
4528
#### Example
4629

4730
<details>
@@ -227,7 +210,7 @@ But if you really want to import the whole ECharts bundle without having to impo
227210
import "echarts";
228211
```
229212

230-
### CDN & Global variable
213+
### CDN
231214

232215
Drop `<script>` inside your HTML file and access the component via `window.VueECharts`.
233216

@@ -236,7 +219,7 @@ Drop `<script>` inside your HTML file and access the component via `window.VueEC
236219

237220
<!-- vue3Scripts:start -->
238221
```html
239-
<script src="https://cdn.jsdelivr.net/npm/[email protected].30"></script>
222+
<script src="https://cdn.jsdelivr.net/npm/[email protected].33"></script>
240223
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
241224
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
242225
```

README.zh-Hans.md

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,16 @@
1515

1616
## 💡 注意 💡
1717

18-
若您准备从 `vue-echarts` ≤ 5 的版本迁移到新版本,请在升级 v6 前阅读 _[迁移到 v6](#迁移到-v6)_ 部分文档。
19-
20-
没准备好的话,可以继续阅读老版本的文档。[前往 →](https://github.com/ecomfe/vue-echarts/blob/5.x/README.zh_CN.md)
18+
还在使用 v6?可以继续阅读老版本的文档。[前往 →](https://github.com/ecomfe/vue-echarts/blob/6.x/README.zh_CN.md)
2119

2220
## 安装 & 使用
2321

24-
### npm & ESM
25-
26-
```sh
27-
npm i echarts vue-echarts
28-
```
29-
30-
要在 _Vue 2_(<2.7.0)下使用 `vue-echarts`,需要确保 `@vue/composition-api` 已经安装(TypeScript 支持还需要 `@vue/runtime-core`):
22+
### npm
3123

3224
```sh
33-
npm i @vue/composition-api
34-
npm i @vue/runtime-core # TypeScript 支持
25+
npm add echarts vue-echarts
3526
```
3627

37-
如果你在使用基于 _Vue 2__NuxtJS_,则需要安装 `@nuxtjs/composition-api`
38-
39-
```sh
40-
npm i @nuxtjs/composition-api
41-
```
42-
43-
然后在 `nuxt.config.js``buildModules` 选项中添加 `'@nuxtjs/composition-api/module'`
44-
4528
#### 示例
4629

4730
<details>
@@ -227,7 +210,7 @@ export default {
227210
import "echarts";
228211
```
229212

230-
### CDN & 全局变量
213+
### CDN
231214

232215
用如下方式在 HTML 中插入 `<script>` 标签,并且通过 `window.VueECharts` 来访问组件接口:
233216

@@ -236,7 +219,7 @@ import "echarts";
236219

237220
<!-- vue3Scripts:start -->
238221
```html
239-
<script src="https://cdn.jsdelivr.net/npm/[email protected].30"></script>
222+
<script src="https://cdn.jsdelivr.net/npm/[email protected].33"></script>
240223
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
241224
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
242225
```

package.json

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,22 @@
77
"author": "GU Yiling <[email protected]>",
88
"scripts": {
99
"serve": "vue-cli-service serve",
10-
"build": "pnpm run docs && rimraf dist && pnpm run build:2 && pnpm run build:3 && vue-demi-switch 3",
11-
"build:2": "vue-demi-switch 2 vue2 && rollup -c rollup.vue2.config.js",
12-
"build:3": "vue-demi-switch 3 && rollup -c rollup.config.js",
10+
"build": "pnpm run docs && rimraf dist && pnpm run build:rollup",
11+
"build:rollup": "vue-demi-switch 3 && rollup -c rollup.config.js",
1312
"lint": "vue-cli-service lint",
1413
"publint": "publint",
1514
"build:demo": "vue-cli-service build",
1615
"docs": "node ./scripts/docs.mjs",
17-
"postinstall": "node ./scripts/postinstall.mjs",
1816
"prepublishOnly": "pnpm run build && publint"
1917
},
2018
"type": "module",
21-
"module": "dist/index.js",
22-
"main": "dist/index.cjs",
19+
"main": "dist/index.js",
2320
"unpkg": "dist/index.min.js",
2421
"jsdelivr": "dist/index.min.js",
2522
"types": "dist/index.d.ts",
2623
"exports": {
27-
".": {
28-
"import": "./dist/index.js",
29-
"require": "./dist/index.cjs"
30-
},
31-
"./csp": {
32-
"import": "./dist/csp/index.js",
33-
"require": "./dist/csp/index.cjs"
34-
},
24+
".": "./dist/index.js",
25+
"./csp": "./dist/csp/index.js",
3526
"./csp/style.css": "./dist/csp/style.css"
3627
},
3728
"files": [

0 commit comments

Comments
 (0)