Reputation: 36
Using the webapp generator, I have created a yeoman project. I have some html templates in the app folder in a 'templates' directory. I am able to get these files revved when running grunt build; however, I am not able to update to references to the html templates in the js files in the 'scripts' directory. Is it possible to use the usemin task on js files or is it a bad idea to rev html templates used by js files in the first place?
Before building: -root -app index.html -templates template1.html -scripts script1.js (used template1.html)
After building: -root index.html -templates 43643.template1.html -scripts 345345.script1.js (does not update ref to template1.html)
My gruntfile is pretty basic, just added directories to the rev task. Any suggestions would be appreciated. Thanks in advance.
Upvotes: 0
Views: 1497
Reputation: 2536
you can use patterns like in the following question: Using grunt-usemin with dynamically generated image paths
I used this to search revisoned js files into other js files.
When you do this, bear in mind that you have to write all relative path in the, in my case I had to change something like:
...
var file = basePath + 'filename.js';
...
to
...
var file = 'base/path/filename.js';
...
Cheers,
Upvotes: 0