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.

replace text specified replacement using grunt replace


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -