問題描述
在編寫 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 約定的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!