Building the Galacean ecosystem to support adaption for mini-games, applets, and other multi-platform applications.
Before using the CLI, ensure that you have installed the engine dependencies of the supported version if needed, such as @galacean/engine
.
-
Install Dependencies
npm install @galacean/platform-adapter
-
Run CLI
If you more like to use the CLI, you can run the following command to bundle the engine and polyfill.
npx platform-adapter --p true --e @galacean/engine/dist/module.js @galacean/engine-spine/dist/module.js --wasm @galacean/engine-physics-physx/lib/physx.release.js --o ./dist
Not all params need to option. Use the
--help
option to view the available commands and options.
Description Of CLI
And ADAPTER_BUNDLE_SETTINGS
-
--p
,--polyfill
: Whether to bundle the polyfill, if using custom engine components, this option can be set to false. -
--e
,--engine
: The engine modules to bundle, specified as a list of engine module file paths, use a blank space to separate each path. If array is empty, the engine will not be bundled. -
--wasm
,--jsWASMLoader
: The wasm loader for the engine, use a blank space to separate each path. If array is empty, the jsWASMLoader will not be bundled. -
--o
,--output
: The output directory for the bundled files, if not specified, the bundled files will be placed in the same directory as the action.yaml.Note: The engine modules and jsWASMLoader should contains `@galacean/xxx/' as name, otherwise the build will fail.
dist/
- ${platformName}/ # Platform name, e.g., WeChat: wechat
- minigame/ # Mini-game platform
- galacean-js/ # Engine output
- engine.js
- ...
- polyfill.js # Platform-specific WebAPI
- miniprogram/ # Mini-program platform
- ...