You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constgulp=require('gulp');constreplaceEach=require('gulp-replace-each');constKEYWORDS=['(Test)','(saySomething)',].map((value)=>{returnnewRegExp(value,'g');});gulp.task('replace-all',()=>{returngulp.task(['testFile.js']).pipe(replaceEach(KEYWORDS/* array or just RegExp object */,(arrayIndex,value,_1)=>{// the first argument is array index, other arguments are arguments from string replace function callbackletresult=_1;if(arrayIndex===1){result+='Funny';}else{result+='1';}returnresult;})).pipe(gulp.dest('dist'))});