什么是“{。tmp,app}”在Yeoman发电机? [英] What is "{.tmp,app} " in Yeoman generator?
问题描述
我开始使用Yeoman工作流程,但我似乎无法完全理解index.html文件中usemin任务的替代搜索路径。例如,使用'yo angular'命令生成2个块:
<! - build:js scripts / modules.js - >
< script src =bower_components / angular-resource / angular-resource.js>< / script>
< script src =bower_components / angular-cookies / angular-cookies.js>< / script>
< script src =bower_components / angular-sanitize / angular-sanitize.js>< / script>
< script src =bower_components / angular-route / angular-route.js>< / script>
<! - endbuild - >
vs。
<! - build:js({。tmp,app})scripts / scripts.js - >
< script src =scripts / app.js>< / script>
< script src =scripts / controllers / main.js>< / script>
< script src =scripts / directives / multiselect.js>< / script>
<! - endbuild - >
为什么第二个有{.tmp,app}替代搜索路径它的意思是)?
<! - build:js({。tmp ,app})scripts / scripts.js - >
<! - endbuild - >
在yeoman中,js脚本可用于 app
文件夹,但当用户使用 CoffeeScript
grunt任务时,会将 .coffee
文件转换为 .js
文件。那些生成的 .js
文件将在 .tmp
文件夹中以相同的文件夹结构可用。
在这些情况下,({。tmp,app})
用于告诉grunt-usemin在 app 和 .tmp 文件夹,以便构建不会错过生成的js文件。
$ b
scripts / scripts.js
是构建之后的目标文件。
I am getting started with the Yeoman workflow, but I can't seem to completely understand the "alternate search path" for the usemin task in the index.html file. For example, there are 2 blocks generated with the 'yo angular' command:
<!-- build:js scripts/modules.js -->
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<!-- endbuild -->
vs.
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/controllers/main.js"></script>
<script src="scripts/directives/multiselect.js"></script>
<!-- endbuild -->
Why does the second one have the {.tmp, app} "alternate search path" (what does it mean)? Thanks in advance.
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<!-- endbuild -->
In yeoman js scripts are available in the app
folder, but when the user is using CoffeeScript
grunt task will convert .coffee
files to .js
files. Those generated .js
files will be available in .tmp
folder with the same folder structure.
In those condition ({.tmp,app})
is used to tell grunt-usemin to search both in app and .tmp folder, so that the build won't miss out generated js files.
scripts/scripts.js
is the destination file after the build.
这篇关于什么是“{。tmp,app}”在Yeoman发电机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!