gruntjs - add variable id in script tags using grunt -
i have around 10 files eg: file1.html, file2.html, fil31.html, file4.html
each file contains starting , end script tag blank id='' field
i want add id's script tags in each file.
the id's file names.
before running grunt eg: file1.html <script type='text/ng-template' id=''> <div>couple of other dive tags</div> </script> after running grunt id filed should have if file name eg: file1.html <script type='text/ng-template' id='file1.html'> <div>couple of other dive tags</div> </script>
i have tried using couple grunt packages can't head around how make them pick file name , add them ids.
grunt file_append grunt-script-link-tags
has faced same problem or knows how solve this?
use following code add id's dynamically in script tag.
Comments
Post a Comment