Directory Structure
A MiniApp Mini Program consists of an app
descriptor and multiple page
descriptors, each describing a specific page of the Mini Program.
Directory Structure of a Mini Program
.
├── pages // Pages of the Mini Program
│ ├── index.css // Page-specific stylesheet
│ ├── index.dlt // Page-specific template
│ ├── index.js // Page-specific logic
│ └── index.json // Page-specific configuration
├── app.css // Global stylesheet for the Mini Program
├── app.js // Global logic for the Mini Program
└── app.json // Global configuration for the Mini Program
Main Components
The main components of a Mini Program are three files that must be located in the project's root directory, as follows:
File | Required | Purpose |
---|---|---|
app.js | Yes | Logic for the Mini Program |
app.json | Yes | Global configuration for the Mini Program |
app.css | No | Global stylesheet for the Mini Program |
Page Components
Each individual page in a Mini Program is composed of four files:
File | Required | Purpose |
---|---|---|
.js | Yes | Page-specific logic |
.dlt | Yes | Page-specific template |
.json | No | Page-specific configuration |
.css | No | Page-specific stylesheet |
Note: For ease of development and to reduce configuration, the four files describing a page must have the same file name and path.
Allowed Uploadable Files In the project directory, the following files are compiled, making them inaccessible after upload: .js, app.json, .dlt, and *.css (for pages configured in app.json). In addition, only files with extensions listed in the whitelist can be uploaded. Files not listed in the whitelist can be accessed in the development tool but cannot be uploaded. The whitelist includes:
- png
- jpg
- jpeg
- gif
- svg
- json
- cer
- mp3
- aac
- m4a
- mp4
- wav
- ogg
- silk
- wasm
- br
- cert