Skip to content

Commit

Permalink
fix(web): cesium base url version (#1204)
Browse files Browse the repository at this point in the history
fix: cesium base url
  • Loading branch information
nourbalaha authored and yk-eukarya committed Oct 1, 2024
1 parent dbf53f1 commit b24b24e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import { configDefaults } from "vitest/config";

// https://vitejs.dev/config/
export default defineConfig(() => {
const packageJson = JSON.parse(readFileSync(resolve(__dirname, "package.json"), "utf-8"));
const cesiumVersion = packageJson.dependencies?.["cesium"];
const cesiumPackageJson = JSON.parse(
readFileSync(resolve(__dirname, "node_modules", "cesium", "package.json"), "utf-8"),
);

return {
server: {
Expand All @@ -26,9 +27,7 @@ export default defineConfig(() => {
plugins: [
react(),
yaml(),
cesium({
cesiumBaseUrl: `cesium-${cesiumVersion}/`,
}),
cesium({ cesiumBaseUrl: `cesium-${cesiumPackageJson.version}/` }),
serverHeaders(),
config(),
],
Expand Down

0 comments on commit b24b24e

Please sign in to comment.