mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-17 05:30:52 +08:00
chore: move to pnpm and refine build
This commit is contained in:
32557
package-lock.json
generated
32557
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
32
package.json
32
package.json
@ -5,12 +5,14 @@
|
|||||||
"author": "GU Yiling <justice360@gmail.com>",
|
"author": "GU Yiling <justice360@gmail.com>",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
"build": "npm run docs && rimraf dist && rollup -c rollup.config.js",
|
"build": "pnpm run docs && rimraf dist && pnpm run build:2 && pnpm run build:3 && vue-demi-switch 3",
|
||||||
|
"build:2": "vue-demi-switch 2 vue2 && rollup -c rollup.vue2.config.js",
|
||||||
|
"build:3": "vue-demi-switch 3 && rollup -c rollup.config.js",
|
||||||
"lint": "vue-cli-service lint",
|
"lint": "vue-cli-service lint",
|
||||||
"build:demo": "vue-cli-service build",
|
"build:demo": "vue-cli-service build",
|
||||||
"docs": "node -r esm ./scripts/docs.js",
|
"docs": "node -r esm ./scripts/docs.js",
|
||||||
"postinstall": "node ./scripts/postinstall.js",
|
"postinstall": "node ./scripts/postinstall.js",
|
||||||
"prepare": "npm run build"
|
"prepare": "pnpm run build"
|
||||||
},
|
},
|
||||||
"main": "dist/index.cjs.min.js",
|
"main": "dist/index.cjs.min.js",
|
||||||
"module": "dist/index.esm.min.js",
|
"module": "dist/index.esm.min.js",
|
||||||
@ -21,9 +23,10 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"resize-detector": "^0.3.0",
|
"resize-detector": "^0.3.0",
|
||||||
"vue-demi": "^0.12.1"
|
"vue-demi": "^0.12.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.17.10",
|
||||||
"@rollup/plugin-node-resolve": "^11.1.1",
|
"@rollup/plugin-node-resolve": "^11.1.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
||||||
"@typescript-eslint/parser": "^4.15.1",
|
"@typescript-eslint/parser": "^4.15.1",
|
||||||
@ -31,30 +34,33 @@
|
|||||||
"@vue/cli-plugin-eslint": "^5.0.4",
|
"@vue/cli-plugin-eslint": "^5.0.4",
|
||||||
"@vue/cli-plugin-typescript": "^5.0.4",
|
"@vue/cli-plugin-typescript": "^5.0.4",
|
||||||
"@vue/cli-service": "^5.0.4",
|
"@vue/cli-service": "^5.0.4",
|
||||||
"@vue/compiler-sfc": "^3.1.1",
|
"@vue/compiler-sfc": "^3.2.33",
|
||||||
"@vue/composition-api": "^1.6.1",
|
"@vue/composition-api": "^1.6.1",
|
||||||
"@vue/eslint-config-prettier": "^6.0.0",
|
"@vue/eslint-config-prettier": "^6.0.0",
|
||||||
"@vue/eslint-config-typescript": "^7.0.0",
|
"@vue/eslint-config-typescript": "^10.0.0",
|
||||||
"codesandbox": "^2.2.3",
|
"codesandbox": "^2.2.3",
|
||||||
"comment-mark": "^1.0.0",
|
"comment-mark": "^1.0.0",
|
||||||
"echarts": "^5.3.2",
|
"echarts": "^5.3.2",
|
||||||
"eslint": "^7.20.0",
|
"eslint": "^7.20.0",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
"eslint-plugin-vue": "^7.6.0",
|
"eslint-plugin-vue": "^8.7.1",
|
||||||
"esm": "^3.2.25",
|
"esm": "^3.2.25",
|
||||||
"postcss": "^8.3.0",
|
"postcss": "^8.3.0",
|
||||||
"postcss-loader": "^5.0.0",
|
"postcss-loader": "^5.0.0",
|
||||||
"postcss-nested": "^5.0.5",
|
"postcss-nested": "^5.0.5",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.6.2",
|
||||||
"resize-detector": "^0.3.0",
|
"resize-detector": "^0.3.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rollup": "^2.38.5",
|
"rollup": "^2.72.1",
|
||||||
"rollup-plugin-dts": "^2.0.1",
|
"rollup-plugin-dts": "^4.2.1",
|
||||||
"rollup-plugin-styles": "^3.14.1",
|
"rollup-plugin-styles": "^4.0.0",
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"rollup-plugin-typescript2": "^0.29.0",
|
"rollup-plugin-ts": "^2.0.7",
|
||||||
"typescript": "~4.1.5",
|
"tslib": "^2.4.0",
|
||||||
"vue": "^3.2.33"
|
"typescript": "4.6.4",
|
||||||
|
"vue": "^3.2.33",
|
||||||
|
"vue2": "npm:vue@^2.6.14",
|
||||||
|
"webpack": "^5.72.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@vue/composition-api": "^1.0.5",
|
"@vue/composition-api": "^1.0.5",
|
||||||
|
9089
pnpm-lock.yaml
generated
Normal file
9089
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,25 +1,38 @@
|
|||||||
import typescript from "rollup-plugin-typescript2";
|
import typescript from "rollup-plugin-ts";
|
||||||
import { terser } from "rollup-plugin-terser";
|
import { terser } from "rollup-plugin-terser";
|
||||||
import resolve from "@rollup/plugin-node-resolve";
|
import resolve from "@rollup/plugin-node-resolve";
|
||||||
import styles from "rollup-plugin-styles";
|
import styles from "rollup-plugin-styles";
|
||||||
import dts from "rollup-plugin-dts";
|
import { injectVueDemi } from "./scripts/rollup";
|
||||||
import { injectVueDemi, ingoreCss } from "./scripts/rollup";
|
|
||||||
|
|
||||||
/** @type {import('rollup').RollupOptions[]} */
|
/** @type {import('rollup').RollupOptions[]} */
|
||||||
const options = [
|
const options = [
|
||||||
|
{
|
||||||
|
input: "src/index.ts",
|
||||||
|
plugins: [
|
||||||
|
typescript({
|
||||||
|
tsconfig: resolvedConfig => ({ ...resolvedConfig, declaration: true }),
|
||||||
|
hook: {
|
||||||
|
outputPath: (path, kind) =>
|
||||||
|
kind === "declaration" ? "dist/index.d.ts" : path
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
styles()
|
||||||
|
],
|
||||||
|
external: ["vue-demi", "echarts/core", "resize-detector"],
|
||||||
|
output: {
|
||||||
|
file: "dist/index.esm.js",
|
||||||
|
format: "esm",
|
||||||
|
sourcemap: true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
input: "src/index.ts",
|
input: "src/index.ts",
|
||||||
plugins: [typescript(), styles()],
|
plugins: [typescript(), styles()],
|
||||||
external: ["vue-demi", "echarts/core", "resize-detector"],
|
external: ["vue-demi", "echarts/core", "resize-detector"],
|
||||||
output: [
|
output: [
|
||||||
{
|
|
||||||
file: "dist/index.esm.js",
|
|
||||||
format: "es",
|
|
||||||
sourcemap: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
file: "dist/index.esm.min.js",
|
file: "dist/index.esm.min.js",
|
||||||
format: "es",
|
format: "esm",
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
terser({
|
terser({
|
||||||
@ -89,22 +102,6 @@ const options = [
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
input: "src/index.ts",
|
|
||||||
plugins: [ingoreCss, dts()],
|
|
||||||
output: {
|
|
||||||
file: "dist/index.d.ts",
|
|
||||||
format: "es"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: "src/index.vue2.d.ts",
|
|
||||||
plugins: [dts()],
|
|
||||||
output: {
|
|
||||||
file: "dist/index.vue2.d.ts",
|
|
||||||
format: "es"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
15
rollup.vue2.config.js
Normal file
15
rollup.vue2.config.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import dts from "rollup-plugin-dts";
|
||||||
|
|
||||||
|
/** @type {import('rollup').RollupOptions[]} */
|
||||||
|
const options = [
|
||||||
|
{
|
||||||
|
input: "src/index.vue2.d.ts",
|
||||||
|
plugins: [dts()],
|
||||||
|
output: {
|
||||||
|
file: "dist/index.vue2.d.ts",
|
||||||
|
format: "esm"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export default options;
|
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable vue/multi-word-component-names */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import {
|
import {
|
||||||
defineComponent,
|
defineComponent,
|
||||||
|
@ -19,6 +19,7 @@ const METHOD_NAMES = [
|
|||||||
"isDisposed",
|
"isDisposed",
|
||||||
"dispose"
|
"dispose"
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
type MethodName = typeof METHOD_NAMES[number];
|
type MethodName = typeof METHOD_NAMES[number];
|
||||||
|
|
||||||
type PublicMethods = Pick<EChartsType, MethodName>;
|
type PublicMethods = Pick<EChartsType, MethodName>;
|
||||||
|
@ -375,6 +375,7 @@ registerMap("world", worldMap);
|
|||||||
registerTheme("ovilia-green", theme);
|
registerTheme("ovilia-green", theme);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: "vue-echarts-demo",
|
||||||
components: {
|
components: {
|
||||||
VChart
|
VChart
|
||||||
},
|
},
|
||||||
|
3
src/index.vue2.d.ts
vendored
3
src/index.vue2.d.ts
vendored
@ -1,6 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/ban-types */
|
/* eslint-disable @typescript-eslint/ban-types */
|
||||||
import { DefineComponent } from "@vue/runtime-dom";
|
import { Ref, DefineComponent } from "vue-demi";
|
||||||
import { Ref } from "@vue/composition-api";
|
|
||||||
import { Option, InitOptions, UpdateOptions, EChartsType } from "./types";
|
import { Option, InitOptions, UpdateOptions, EChartsType } from "./types";
|
||||||
|
|
||||||
declare const LOADING_OPTIONS_KEY = "ecLoadingOptions";
|
declare const LOADING_OPTIONS_KEY = "ecLoadingOptions";
|
||||||
|
Reference in New Issue
Block a user