EsseTi
EsseTi

Reputation: 4271

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

i'm using yeoman as tool for mantaining the app organized. Since i've many directives i did not use the standard way the yeoman generate the directive, thus scripts/directive/name.js for the code and views/template_directive.html for the template.

I instead did this: scripts/directive/my-directive and inside i've the js and html file. here a screenshot

Now, when i serve everything works well, the problem araises when i run the build. the js of the directives ends up in the vendor.js but the html page still points to scripts/directive/my-directive/template_directive.html which is not part of the dist.

What I should (probably, if there's better options more than welcome) do is:

or

the question is:

Upvotes: 0

Views: 127

Answers (1)

EsseTi
EsseTi

Reputation: 4271

I did like this (not sure if it's "correct" but works)

add this in the copy section

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

add this to the minhtml conf

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

Upvotes: 1

Related Questions