Directory structure introduction


tmt-workflow/
│
├── _tasks                            //Gulp 任务定义├── package.json
├── .tmtworkflowrc                    //工作流配置文件└── project                           //项目目录
    ├── gulpfile.js                   //任务配置,每个项目必需
    ├── dev                           //开发目录,由 build_dev 任务自动生成
    │   ├── css
    │   ├── html
    │   ├── img
    │   └── slice
    ├── dist                          //生产目录(存放最终可发布上线的文件),由 build_dist 任务自动生成
    │   ├── css
    │   ├── html
    │   ├── img
    │   └── sprite                    //雪碧图合并自 src/slice,文件名与 css 文件名一致
    │       ├── style-index.png
    │       └── style-index@2x.png
    └── src                           //源文件目录,此目录会被监听变化并重新编译->dev
        ├── css                       //样式表目录,使用 Less,只有 style-*.less 的文件名会被编译
        ├── html
        ├── img
        └── slice                     //图片素材,雪碧图合并,同名的 @2x 图片会被识别并进行合并
            ├── icon-dribbble.png
            ├── icon-dribbble@2x.png

As above, in our daily development, all projects are stored in one directory, for example, it can be called tmt-workflow, and the fixed directory is _tasks Directory, package.json and .tmtworkflowrc, these are required for workflow.

  • _tasks: Directory to store Gulp code
  • package.json: Module dependency file, used for npm install
  • .tmtworkflowrc : Workflow global configuration file. If you want to specialize a project, you can create another file with the same name in the project to cover it. View it in more detail ⒊ Configuration file

Then there are each project (project), a standard project structure is as follows:

── project                              //项目目录
    ├── gulpfile.js                     //任务配置,每个项目必需
    └── src                             //源文件目录,此目录会被监听变化并重新编译->dev
        ├── css                         //样式表目录,使用 Less,只有 style-*.less 的文件名会被编译
        ├── html
        ├── img
        └── slice                       //图片素材,雪碧图合并,同名的 @2x 图片会被识别并进行合并
            ├── icon-dribbble.png
            ├── icon-dribbble@2x.png

Note: The standard project structure is only as shown above, build_dev and build_dist are programs Automatic generated.