Remove scripts from index.html through gulp

angularjs, gulp, javascript

Solution

You can use the gulp-html-replace plugin which is intended for this specific purpose :

https://www.npmjs.org/package/gulp-html-replace

Problem

I'am using gulp in our application, we have 2 flows in Gulpfile.js, one for production and second for development, but I dont want to keep 2 index.html files e.g. index.html and index.dev. html, I want to have one index.html file, but for production build I have scripts which are no needed e.g . ``` <!--dev depends --> <script src="angular-mocks/angular-mocks.js"></script> <script src="server.js"></script> <!--dev depends --> ``` question is: How can I remove something from html through Gulp ?

Original source