mars3d&cesium library plugin for Vite
https://www.npmjs.com/package/vite-plugin-earth
小冰cc 328aca1489 | ||
---|---|---|
src | ||
.gitignore | ||
.prettierrc | ||
LICENSE | ||
README.md | ||
package.json | ||
pnpm-lock.yaml | ||
tsconfig.json |
README.md
⚡ vite-plugin-earth
Easily set up a Cesium
& mars3d
project in [Vite
].
Install
npm i cesium vite-plugin-earth vite -D
# yarn add cesium vite-plugin-earth vite -D
Usage
add this plugin to vite.config.js
import { defineConfig } from 'vite';
import earthPlugin from 'vite-plugin-earth';
export default defineConfig({
plugins: [earthPlugin()]
});
add dev command to package.json
"scripts": {
"dev": "vite",
"build": "vite build"
}
run:
yarn dev
Options
rebuildCesium
- Type :
boolean
- Default :
false
Default copy min cesium file to dist. if true
will rebuild cesium from source.
import { defineConfig } from 'vite';
import earthPlugin from 'vite-plugin-earth';
export default defineConfig({
plugins: [
earthPlugin({
rebuildCesium: true
})
]
});