{"id":22684,"library":"vite-plugin-gvemap","title":"vite-plugin-gvemap","description":"A Vite plugin that simplifies integrating the gvemap (Cesium-based) library into Vite projects. Version 1.1.15, actively maintained. It handles Cesium static assets, worker files, and module resolution. Key differentiators: automatic copy of Cesium assets to build output, optional rebuild from source, and seamless Cesium import. Requires gvemap ^1.1.1 and Vite >=2.7.1, ships TypeScript types.","status":"active","version":"1.1.15","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","vite","vite-plugin","cesium","typescript"],"install":[{"cmd":"npm install vite-plugin-gvemap","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-gvemap","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-gvemap","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: the GIS mapping library that this plugin integrates with","package":"gvemap","optional":false},{"reason":"Peer dependency: the build tool that this plugin extends","package":"vite","optional":false}],"imports":[{"note":"ESM-only plugin, cannot be used with require() in CJS.","wrong":"const cesium = require('vite-plugin-gvemap')","symbol":"default (plugin)","correct":"import cesium from 'vite-plugin-gvemap'"},{"note":"Named export is exactly 'cesium', not 'cesiumPlugin'.","wrong":"import { cesiumPlugin } from 'vite-plugin-gvemap'","symbol":"cesium (named export)","correct":"import { cesium } from 'vite-plugin-gvemap'"},{"note":"The plugin integrates the 'gvemap' package, but Cesium symbols are imported from 'cesium' (or the cesium namespace).","wrong":"import { Viewer } from 'gvemap'","symbol":"Cesium.Viewer","correct":"import { Viewer } from 'cesium'"}],"quickstart":{"code":"import { defineConfig } from 'vite';\nimport cesium from 'vite-plugin-gvemap';\n\nexport default defineConfig({\n  plugins: [cesium()]\n});","lang":"typescript","description":"Minimal Vite configuration to add the gvemap plugin, enabling Cesium GIS support in a Vite project."},"warnings":[{"fix":"Do not manually alter node_modules/cesium; rely on the plugin's automatic copy.","message":"The plugin copies Cesium static assets from node_modules/cesium to the public directory at build time. If you delete or modify those assets manually, the build may break.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Only enable rebuildCesium if you need custom Cesium modifications; otherwise keep default false.","message":"When using `rebuildCesium: true`, the plugin rebuilds Cesium from source, which requires additional build tools (e.g., Node.js, rollup) and significantly increases build time.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Remove any `cesiumPath` option; ensure 'cesium' is installed as a dependency.","message":"The option `cesiumPath` was removed in v1.1.0. Previously you could specify a custom path to Cesium; now the plugin uses the 'cesium' package from node_modules.","severity":"deprecated","affected_versions":">=1.1.0"},{"fix":"Run `npm install cesium` or `yarn add cesium`.","message":"The plugin expects the 'cesium' package to be installed, not the 'gvemap' package directly (gvemap is the package name but it re-exports cesium). Make sure you install 'cesium' as a dependency.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install cesium: `npm install cesium`","cause":"Cesium package not installed or not in node_modules.","error":"Failed to resolve import \"cesium\" from \"src/index.js\". Does the file exist?"},{"fix":"Use `import cesium from 'vite-plugin-gvemap'` (default) not `import { cesium } from 'vite-plugin-gvemap'`.","cause":"Using default import instead of named import when plugin expects a default export.","error":"TypeError: cesium is not a function"},{"fix":"Install cesium as a dependency.","cause":"The plugin tries to resolve 'cesium' but it's missing.","error":"The 'cesium' package could not be found. Make sure it is installed."},{"fix":"Reinstall cesium: `npm reinstall cesium`","cause":"The 'cesium' package may be installed incorrectly or has a different structure.","error":"[vite] Build failed with 1 error: ENOTDIR: not a directory, copyfile '.../node_modules/cesium/Build/Cesium/Cesium.js'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}