2015-07-10 29 views
0

我使用yeoman作为维护应用程序的工具。由于我有很多指令,我没有使用yeoman生成指令的标准方式,因此代码为scripts/directive/name.js,模板为views/template_directive.htmlYeoman/gruntjs angularjs和文件夹中的html文件的指令

我反而做了这个: scripts/directive/my-directive和里面我有jshtml文件。 here a screenshot

现在,当我serve一切正常,当我运行build时,问题aaseises。指令的jsvendor.js结尾,但html页面仍指向scripts/directive/my-directive/template_directive.html,这不是dist的一部分。

我应该(可能是,如果有更好的选择多人欢迎)做的是:

  • 复制html视图中的文件夹
  • 变化refence该指令的JS

  • 发现一种方法来在同一文件夹中的html文件也为DIST(重新创建所有/directives/<directive>/<template>.html

的问题是:

  • 什么是“正确”的解决方案
  • 有什么命令改变gruntjs使其工作。

回答

1

我不喜欢这个(不知道这是否是 “正确的”,但工程)

copy中添加该

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

它添加到minhtml的conf

files: [{ 
    ... 
    src: [..,'scripts/directives/*/*.html'], 
    ... 
}] 
相关问题