Using Regex In Grunt-contrib-copy's "process" Option Not Working
I'm trying to remove my live reload script from my index.html file dynamically using Grunt's copy plugin. The part of my Gruntfile with the code in question is here: copy: {
Solution 1:
your options are in the wrong place, they need to be one level higher:
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, " ");
}
}
Post a Comment for "Using Regex In Grunt-contrib-copy's "process" Option Not Working"