I am trying to remove the current reload script from my index.html file dynamically using the Grunt copy plugin.
Part of my Grunt file with this code is here:
copy: { main: { files: [ { expand: true, src: 'index.html', dest: 'build/', options: { process: function (content, srcpath){ return content.replace(/<script src = "http:\/\/localhost:9090\/livereload.js"><\/script>/g, " "); } } },
I checked the regular expression tester and showed that the regular expression I have above should match the script in my html.
Although the regexp tester says it is legal, I had incorrect results with matches before, so I need help here to determine if there is a problem with my Gruntfile or my regex. Any suggestions?
source share