Yeoman/gruntjs angularjs 和文件夹中包含 html 个文件的指令

Yeoman/gruntjs angularjs and directives with html files in the folder

我正在使用 yeoman 作为维护应用程序的工具。因为我有很多指令,所以我没有使用 yeoman 生成指令的标准方式,因此 scripts/directive/name.js 用于代码,views/template_directive.html 用于模板。

我改为这样做: scripts/directive/my-directive 里面有 jshtml 文件。 here a screenshot

现在,当我 serve 一切正常时,问题出现在我 运行 build 时。 js 指令在 vendor.js 中结束,但 html 页面仍然指向 scripts/directive/my-directive/template_directive.html,这不是 dist.

的一部分

我应该做的(如果有更好的选择更受欢迎的话)我应该做的是:

问题是:

我喜欢这个(不确定它是否 "correct" 但有效)

将此添加到 copy 部分

..
{
 expand: true,
 dot: true,
 cwd: '<%= yeoman.app %>/scripts/directives',
 src: ['*/*.html'],
 dest:'<%= yeoman.dist %>/scripts/directives'
}
..

将此添加到 minhtml conf

files: [{
   ...
   src: [..,'scripts/directives/*/*.html'],
   ...
}]