Use AntCubeTool

更新时间:
复制 MD 格式

AntCubeTool (ACT) provides CLI commands to create and compile Cube card projects.

Create a new project

Run act init to create a new project.

Configuration fields such as name are used as file and folder names and can contain only letters, numbers, underscores, and hyphens.

➜  ~ act init -h
Usage: act init [options]

Initialize a Cube application in the current directory

Options:
  -h, --help        display help for command

Compile a project

Run act build to compile a Cube project in the specified directory.

path specifies the project directory to compile. options controls compilation settings such as debug mode.

➜  ~ act build -h
Usage: @antdigital/cube build [options] [path]

Compile the Cube project in the specified path. The current path is used if a path is not specified.

Options:
  --batch              Enable batch processing mode. Supported only for Card 1.0 projects. (default: false)
  --watch              Enable real-time compilation. Not supported in batch processing mode. (default: false)
  --debug              Enable debug mode. (default: false)
  --bytecode           Enable JS bytecode. (default: false)
  --bizcode [bizcode]  The line-of-business to which the project belongs. (default: "")
  --page-id [id]       The ID of a single page.
  --page-sign          Securely sign the build artifact. (default: false)
  -h, --help           Display help information.

Compile dynamic assets

Run act build-asset to compile dynamic assets in the specified directory.

path specifies the project directory that contains the dynamic assets to compile.

➜  ~ act build-asset -h 
Usage: @antdigital/cube build-asset [path]

Compile dynamic assets

Options:
  --only <step>  Build assets step by step. Steps: prepare | build | revert
  -h, --help     Display help information.