H
H
HamSter2016-07-08 17:22:56
JavaScript
HamSter, 2016-07-08 17:22:56

Replacing js files with gulp-replace for multiple lines?

How can I write pipefor gulp-replacefor multiple js in gulpfile.js ?
In index.html :

<script src="js/main.js"></script>
<script src="js/plagin-1.min.js"></script>
<script src="js/plagin-2.js"></script>

In gulpfile.js now it's like this:
.pipe(replace('main.js', assets['main.js']))
How to make a replacement for all js files, and not for one main.js, so that it looks like this:
<body>
...
<script src="js/main-0aff1519.js"></script>
<script src="js/plagin-1.min-c52476c9.js"></script>
<script src="jsplagin-2-da39a3ee.js"></script>
...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory S., 2016-07-08
@Grigory90

Use regular.
https://www.npmjs.com/package/gulp-replace#regex-r...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question