Learn about the project configuration and directory structure of Ant Cube Card.
Project directory structure
A valid card project consists of a configuration file .act.config.json in the project root directory and a set of card description files such as .vue, .css, and .json. The directory structure is as follows:
.
├── dist // The compilation result folder (automatically generated when you perform the compilation operation)
│ ├── app.manifest // The application configuration information (the naming format is fixed)
│ ├── test_cube
| | ├── main.bin // The binary file of the compiled product.
| | ├── main.json // The JSON file that is compiled.
| | ├── main.mock // The compilation product of mock.json
| | ├── main.js // The JS logic segment of the compiled product, which facilitates run time troubleshooting of JS segment exceptions.
| | └ ── main.zip // The overall package file for all products of the card.
├── test_cube
│ ├── main.vue // [Required] card source code file, file name cannot be changed
│ ├── mock.json // [Optional] Card mock data
│ ├── manifest.json // [Required] The card compilation configuration file. The file name cannot be changed.
| └ ── main.css // [Optional] card style file
└ ── .act.config.json // [Required] project configuration file, file name cannot be changed
.act.config.json
The .act.config.json file is the configuration file for the card project. It is generated by the Ant Cube Card command-line tool and does not require manual modification.
The .act.config.json must be under the root directory of the Works.
//.act.config.json
{
"type": "templates", // Required. The project type. Valid values: templates.
}
manifest.json
The manifest.json file is the compilation configuration file for the card. It is generated by the Ant Cube Card command-line tool and does not require manual modification.
The manifest.json must be under the same path as the corresponding card main.vue.
// manifest.json
{
"name": "my-card", // Optional. The card name. After the card is published, the card ID prevails.
"version": "x.x.x", // Optional. The card version. After the card is published, the background version of the card prevails.
"compilerType": 1, // Optional. The card compilation mode. 0 (static card) | 1 (dynamic card. JS is supported. Recommended). Default value: 0.
"jsformat": 1, // Optional. The card JS compilation format. 0 (expression export) | 1(IIFE export. JS import is supported. Recommended). Default value: 0.
}
Project example