title: Directory Structure


Directory Structure

  1. ├── dist Compilation results directory
  2. |
  3. ├── config Project compilation configuration directory
  4. | ├── index.js Default Configuration
  5. | ├── dev.js Development environment configuration
  6. | └── prod.js Production environment configuration
  7. |
  8. ├── src Source directory
  9. | ├── pages Page file directory
  10. | | └── index index Page directory
  11. | | ├── index.js index page
  12. | | ├── index.css index page style
  13. | | └── index.config.js index page configuration
  14. | |
  15. | ├── app.js Project entry
  16. | ├── app.css Project general style
  17. | └── app.config.js Project entry configuration
  18. |
  19. ├── project.config.json Wechat mini program configuration
  20. ├── project.tt.json ByteDance Mini Program configuration
  21. ├── project.swan.json Baidu smart program
  22. ├── project.qq.json QQ Mini Program
  23. |
  24. ├── babel.config.js Babel configuration
  25. ├── tsconfig.json TypeScript configuration
  26. ├── .eslintrc ESLint configuration
  27. |
  28. └── package.json

Compile Configuration

For configuring the build configuration of Taro projects, modifying Webpack configuration, etc., please refer tocompile configurationcompile configuration details

Source Code

Like the mini program specification, Taro contains an app that describes the overall application and multiple pages that describe their respective pages.

app

The mini program contains the following files:

File Required Funtions
app.js yes mini program entry
app.css no mini program global style
app.config.js yes mini program global configuration

Eamples are available for viewing according to the framework of your choice:React, Vue, Vue3

1. Mini Program Global Configuration

app.config.js Global configuration file corresponding to the mini program specification app.json,The advantage is that it is JS files that can write logic. The configuration starts with global configuration of WeChat Mini Progam。Detail reference Global Configuration

2. Mini Program Global Style

Mini Program global style files can be introduced via the ES6 specification’s import.

```js title=”app.js” import ‘./app.css’;

  1. ### page
  2. A mini program page consists of three files:
  3. | File | Required | Funtions |
  4. | :-- | :-- | :-- |
  5. | page.js | yes | page entry |
  6. | page.css | no | page style |
  7. | page.config.js | no | page configuration |
  8. #### 1. Page Configuration
  9. `page.config.js` The page configuration file corresponding to the mini program specification `page.json`The advantage is that it is js configuration to ** Wechat Mini Program page configuration** as specificationDetail reference [page configuration](./page-config)。
  10. #### 2. Page Style
  11. Page style files can be introduced via the ES6 specification `import`.
  12. ```js title="pages/index/index.js"
  13. import './index.css';

3. Page Routing

Page routing is consistent with the mini program specification and needs to be configured in the mini program global configuration app.config.js.

Project Configuration

Each mini program platform has its own project profile, and Taro supports adapting them. For details, please refer toproject configuration

Babel Configuration

Babel configuration reference Github

ESLint Configuration

ESLint configuration reference Github