From 436466b51935f1c4e2455162df9a33fc5ef8f869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=A2=A8?= Date: Thu, 12 Jun 2025 06:12:51 +0800 Subject: [PATCH] =?UTF-8?q?README=20=E4=B8=AD=E6=9B=B4=E6=96=B0=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=8C=87=E5=8D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 342a051..838373f 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,34 @@ - 相对路径问题:本仓库已支持在 vite.config.ts 中配置以下类型的 base: `./`, `/`, `/foo/bar`, `(不设置)` (新创建的项目 base 默认为 `./`,而原仓库针对 `./` 没有做很好的处理) - 资源请求路径:当 base 形如 `/foo/bar` 时,cesium 静态文件由 `/cesium...` 改为请求 `/foo/bar/cesium...` 鉴于原仓库作者可能不再维护此项目(详见:[issue](https://github.com/nshen/vite-plugin-cesium/issues/62#issuecomment-2957419669)),故 fork 本仓库 ([coder-xiaomo/vite-plugin-cesium-next](https://github.com/coder-xiaomo/vite-plugin-cesium-next)) 继续维护,欢迎提交 Issue / Pr ! + +## Install + +```bash +npm i cesium vite-plugin-cesium-text vite -D +# yarn add cesium vite-plugin-cesium-text vite -D +``` + +## Usage + +add this plugin to `vite.config.js` + +```js +import { defineConfig } from 'vite'; +import cesium from 'vite-plugin-cesium-next'; // 👈 添加这一行 + +export default defineConfig({ + plugins: [ + // ... + cesium(), // 👈 添加这一行 + + // 或者如果你需要自定义配置,可以这样写 👇 + // cesium({ /* 这里可以添加配置 */ }), + ] +}); +``` + + --- 以下是原仓库 README