Zero-config Vite plugin for @cesium/engine (v1.6.0) that automatically handles static asset copying, CSS injection, compile-time CESIUM_BASE_URL definition, and Ion token management. Designed specifically for the lightweight @cesium/engine package rather than the full cesium bundle. Key differentiators: no configuration needed for most cases, built-in .env support for per-environment Ion tokens, virtual module for runtime constants, and token validation. Release cadence: active with minor/patch updates every few months. Requires @cesium/engine >=11.0.0 and Vite >=5.0.0.
npm install vite-plugin-cesium-engineVerified import paths — ran on the pinned version, not inferred.
Minimal setup: add the plugin to vite.config.ts, then import and instantiate CesiumWidget.
Update any runtime code that relied on window.CESIUM_BASE_URL; use the virtual:cesium module or plugin options if needed.
Remove any CSP-related plugin options from your configuration.
Use `import { cesiumEngine } from 'vite-plugin-cesium-engine'` instead of default import.Ensure your .env file defines CESIUM_ION_TOKEN or CESIUM_ION_TOKEN_<MODE> and that the file is in the project root. No VITE_ prefix needed.
Install @cesium/engine instead of cesium and update imports accordingly.
Change to `import { cesiumEngine } from 'vite-plugin-cesium-engine'`.Add the plugin in vite.config.ts: `plugins: [cesiumEngine()]`. The virtual module is only available inside Vite's module resolution.
Ensure the plugin is added and you are using @cesium/engine. If using custom assetPath, verify the output directory.