vite-plugin-cesium-plus
v1.1.0
Published
Cesium library plugin for Vite
Downloads
7
Readme
Install
npm install vite-plugin-cesium-plus -D
Usage
add the plugin to vite.config.js
or vite.config.ts
import { defineConfig } from 'vite';
import cesium from 'vite-plugin-cesium-plus';
export default defineConfig({
plugins: [cesium()]
});
Type Declarations
interface VitePluginCesiumPlusOptions {
devMinifyCesium?: boolean;
/**
* Cesium source file root path
* @default "node_modules/cesium/Build"
*/
cesiumBuildRootPath?: string;
/**
* Compiled Cesium code output directory
* @default "cesium/"
*/
cesiumOutputPath?: string;
/**
* Specify the page entry to use cesium in multi page applications
* @example
* // vite.config.ts
* import cesium from 'vite-plugin-cesium-plus';
*
* {
* // ...
* plugins: [
* cesium({
inputIndexHtml: path.resolve(__dirname, 'demo/index.html')
})
],
* rollupOptions: {
* build: {
* input: {
* demo: path.resolve(__dirname, 'demo/index.html')
* },
* // ...
* }
* }
* }
*/
inputIndexHtml?: string | string[];
/**
* Use url instead of compiled Cesium to generate files
* @example
*
* {
* // ...
* plugins: [
* cesium({
cesiumJsUrl: 'https://xxx/Cesium.js'
})
]
* }
* index.html
* <script src="https://xxx/Cesium.js"></script>
*/
cesiumJsUrl?: string;
}