任务名称的Gulp.js约定 [英] Gulp.js conventions for tasks names

查看:51
本文介绍了任务名称的Gulp.js约定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有编写Gulpfile,命名任务间隔,配置配置文件等约定?

Are there any conventions for writing Gulpfiles, namespacing the tasks, structuring the config file etc?

也许可以从Grunt世界中获得一些基本的常识性东西?

Maybe there are some basic common-sense things that can be taken from Grunt world?

您如何处理构造Gulpfile的工作,就像您要辞职一样,下一位JS开发人员会来并直观地了解如何构建该项目?

How do you deal with structuring the Gulpfile as if you were to quit your job and the next JS developer would come and intuitively understand how to build the project?

推荐答案

因此,我们完成了按阶段对名称进行分组的操作,将子任务嵌套在主要阶段的名称下.

So we finished up with grouping the names by phase, nesting subtasks under the names of the main phases.

从本质上讲,我们使用策略从已经存在的其他语言的构建库(例如gradle)中复制约定,因此用于该过程所有部分的构建命令将是相同的,每个人都可以找出要解决的问题

Essentially we used strategy to copy conventions from build libraries of other languages (e.g. gradle) that were already in place, so build commands for all parts of our process would be the same and everybody could figure out what to

结果是:

build
...
build:compile
build:compile:less
...
test
test:unit
...
test:e2e
...
verify
...
release
release:copy
release:copy:fonts

这篇关于任务名称的Gulp.js约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆