Skip to content

Commit

Permalink
chore: upgrade vite plugin cesium applying cesium base url (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
airslice authored Aug 20, 2024
1 parent b3b680f commit 7674393
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"storybook": "8.0.8",
"typescript": "5.2.2",
"vite": "5.0.8",
"vite-plugin-cesium": "1.2.22",
"vite-plugin-cesium": "1.2.23",
"vite-plugin-dts": "3.8.1",
"vite-plugin-svgr": "4.2.0",
"vite-tsconfig-paths": "^4.3.2",
Expand Down
13 changes: 12 additions & 1 deletion vite.config.example.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import { readFileSync } from "fs";
import { resolve } from "path";

import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import cesium from "vite-plugin-cesium";
import tsconfigPaths from "vite-tsconfig-paths";

const cesiumPackageJson = JSON.parse(
readFileSync(resolve(__dirname, "node_modules", "cesium", "package.json"), "utf-8"),
);

// https://vitejs.dev/config/
export default defineConfig({
plugins: [tsconfigPaths(), react(), cesium()],
plugins: [
tsconfigPaths(),
react(),
cesium({ cesiumBaseUrl: `cesium-${cesiumPackageJson.version}/` }),
],
});
2 changes: 0 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { resolve } from "path";

import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import cesium from "vite-plugin-cesium";
import dts from "vite-plugin-dts";
import svgr from "vite-plugin-svgr";
import { configDefaults } from "vitest/config";
Expand All @@ -14,7 +13,6 @@ export default defineConfig(() => ({
plugins: [
svgr(),
react(),
cesium({ rebuildCesium: true }),
dts({ rollupTypes: true }),
],
build: {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10928,10 +10928,10 @@ [email protected]:
picocolors "^1.0.0"
vite "^5.0.0"

[email protected].22:
version "1.2.22"
resolved "https://registry.yarnpkg.com/vite-plugin-cesium/-/vite-plugin-cesium-1.2.22.tgz#55dc6d7dba6f8c28ee815e0d70359d67ef763694"
integrity sha512-OnS+VKNGck4kUu4/67Fdfhz0/zF9mDVNUp9hUWtX19C38O0mJsJy2MH1ev2QcrVLf6VieJ7vCGxkLchdB1n1HQ==
[email protected].23:
version "1.2.23"
resolved "https://registry.yarnpkg.com/vite-plugin-cesium/-/vite-plugin-cesium-1.2.23.tgz#fa6ef37c045fe7863901b383a23e7f72e59e7539"
integrity sha512-x9A8ZCEoegceXg/E+LnxKr0XBsI9CR4cgYWQ2Dd3cUEYwKcTnHQ3kBfpol7BUcGtgQnQos/mtVrRmuVQBXFjHw==
dependencies:
fs-extra "^9.1.0"
rollup-plugin-external-globals "^0.6.1"
Expand Down

0 comments on commit 7674393

Please sign in to comment.