I'm working on a grunt file for work. We work locally with our files being in html and when we implement them into our CMS they need to be converted to aspx.
I'm trying to replace all instances of <script scr=""></script>
with <imod:ScriptPlaceHolder id="#nameOfFile" runat="server" type="FileInclude" url="#pathToFile"></imod:ScriptPlaceHolder>
I'm using "grunt-replace": "^0.8.0." This task is registered under default and build. I've tried using a regex to match the name, and I've been looking at the documentation for far too long. Here is what my grunt file with replace looks like:
replace: {
dist: {
options: {
patterns: [
{
match: '/script src="/g',
replacement: function() {
'asp:PlaceHolder runat="server" url="';
}
}
]
},
files: [
{expand: true, flatten: true, src: ['<%= config.dist %>/index.html'], dest: 'dist/'}
]
}
},