From 7e49190f95e79b9db2d51006b789688e8564f6ee Mon Sep 17 00:00:00 2001 From: Yue JIN <40021217+kingyue737@users.noreply.github.com> Date: Tue, 5 Aug 2025 12:15:21 +0800 Subject: [PATCH] feat!: inject style via constructable `CSSStyleSheet` and remove CSP entry (#847) * chore: not inject inline css on server * feat!: remove csp entry * keep csp title in readme * chore: switch to rolldown and tsdown * update * dedupe * update according to review * emphasize "both" in csp section * load css with unplugin-raw * change tsdown entry --- .prettierignore | 1 + README.md | 2 +- README.zh-Hans.md | 2 +- package.json | 20 +- pnpm-lock.yaml | 1195 +++++++++++++++++++++++--------------------- rollup.config.js | 104 ---- src/ECharts.ts | 2 +- src/style.css | 7 +- src/style.ts | 16 + tsconfig.json | 1 + tsconfig.node.json | 7 +- tsdown.config.ts | 32 ++ 12 files changed, 687 insertions(+), 702 deletions(-) delete mode 100644 rollup.config.js create mode 100644 src/style.ts create mode 100644 tsdown.config.ts diff --git a/.prettierignore b/.prettierignore index 66cf531..6fa51e2 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ pnpm-lock.yaml demo/data/*.json +src/style.css diff --git a/README.md b/README.md index d39cfc1..c485c66 100644 --- a/README.md +++ b/README.md @@ -411,7 +411,7 @@ Static methods can be accessed from [`echarts` itself](https://echarts.apache.or ## CSP: `style-src` or `style-src-elem` -If you are applying a CSP to prevent inline `