-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a feature completely independent of `cesium` support, and has no impact on regular `cesium` users. As this is a major update, it is considered a BREAKING CHANGE. For `@cesium/engine` users, this plugin can be used by `import cesium from 'vite-plugin-cesium-build/engine'`, and the usage is identical to `import cesium from 'vite-plugin-cesium-build'`. Refs: #6
- Loading branch information
Showing
3 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { Plugin } from 'vite' | ||
|
||
import { setBaseUrl } from './core/setBaseUrl' | ||
import { type BuildCesiumOptions, resolveOptions } from './core/resolveOptions' | ||
import { copyCesium } from './core/copyCesium' | ||
|
||
function pluginEntry(pluginOptions?: Partial<BuildCesiumOptions>): Plugin[] { | ||
const options = resolveOptions(pluginOptions, 'node_modules/@cesium/engine') | ||
|
||
return [ | ||
...copyCesium( | ||
options, | ||
[], | ||
[ | ||
{ | ||
src: `${options.from}/Source/Assets/*`, | ||
dest: `${options.to}/Assets/`, | ||
}, | ||
{ | ||
src: `${options.from}/Build/ThirdParty/*`, | ||
dest: `${options.to}/ThirdParty/`, | ||
}, | ||
{ | ||
src: `${options.from}/Build/Workers/*`, | ||
dest: `${options.to}/Workers/`, | ||
}, | ||
], | ||
), | ||
setBaseUrl(options), | ||
] | ||
} | ||
|
||
export default pluginEntry |