A Vite plugin for integrating Mars3D (a 3D GIS platform built on Cesium) into Vite projects. Current stable version 4.2.2, updated 2024-08-13. Provides seamless integration by handling Vite-specific configurations, copy assets, and optional CDN usage. Enables faster HMR and optimized builds for Mars3D applications. Key differentiators: easy setup, TypeScript support, and compatibility with latest Vite versions (v4+).
npm install vite-plugin-mars3dVerified import paths — ran on the pinned version, not inferred.
Basic setup of vite-plugin-mars3d in Vite config, enabling Mars3D integration.
Upgrade to Node.js 16+ and Vite 4+.
Replace 'useCDN: true' with 'cdn: true'.
Ensure mars3dPlugin() is the first element in plugins array.
Add to tsconfig.json: "types": ["vite-plugin-mars3d"]
Run npm install vite-plugin-mars3d --save-dev
Use import mars3dPlugin from 'vite-plugin-mars3d'
Ensure mars3d is installed: npm install mars3d