
Zero-config Cesium.js in Vite — introducing vite-plugin-cesium-engine
If you've ever tried to use CesiumJS with Vite , you know the ritual. Before you can render a globe you have to: Copy WASM workers and assets to your output directory Set window.CESIUM_BASE_URL before any Cesium module loads Inject a <link> tag for CesiumWidget.css Somehow get your Ion access token into the bundle Every project starts the same way: copy-paste from a StackOverflow answer, tweak until it works in dev, discover it breaks in prod, repeat. I built vite-plugin-cesium-engine to make all of that disappear. What it targets There are already a couple of Cesium Vite plugins out there, but they all target the full cesium package — the one that comes with the entire Viewer UI. If you want the lean @cesium/engine core (no widgets, full control over your own UI), you were on your own. This plugin is purpose-built for @cesium/engine only. Installation # npm npm i -D @cesium/engine vite-plugin-cesium-engine # pnpm pnpm add -D @cesium/engine vite-plugin-cesium-engine # yarn yarn add -D
Continue reading on Dev.to
Opens in a new tab




