Closed Rabbitzzc closed 1 year ago
From the readme:
Please note that the value specified in the
from
parameter is passed straight to the native String replace method. As such, if you pass a string as thefrom
parameter, it will only replace the first occurrence.To replace multiple occurrences at once, you must use a regular expression for the
from
parameter with the global flag enabled, e.g./foo/g
.
const options = {
from: /foo/g,
to: 'bar',
};
https://github.com/adamreisnz/replace-in-file/blob/main/lib/helpers/make-replacements.js#L43
need add :