build: update dependency replace-in-file to v8
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
replace-in-file | devDependencies | major | 7.2.0 -> 8.0.0 |
Release Notes
adamreisnz/replace-in-file (replace-in-file)
v8.0.0
The package has been converted to an ES module and now requires Node 18 or higher. If you need support for Node 16 or below, please use version 7.x.x.
Breaking changes
- Package has been converted to an ES module
- No longer providing a default export. Use the named exports
replaceInFile
orreplaceInFileSync
instead. - The
replace.sync
syntax is no longer available. Use the named exportreplaceInFileSync
instead. - The callback API has been removed for asynchronous replacements. Please use promises or
async/await
instead. - Configuration files provided to the CLI using the
--configFile
flag can now only be JSON. - To use a custom
fs
implementation, you must now specifyfs
config parameter for the async API, andfsSync
for the sync API. For the asynchronous APIs, the providedfs
must provide thereadFile
andwriteFile
methods. For the synchronous APIs, the providedfsSync
must provide thereadFileSync
andwriteFileSync
methods. - If a
cwd
parameter is provided, it will no longer be prefixed to each path using basic string concatenation, but rather usespath.join()
to ensure correct path concatenation.
New features
You can now specify a getTargetFile
config param to modify the target file for saving the new file contents to. For example:
const options = {
files: 'path/to/files/*.html',
getTargetFile: source => `new/path/${source}`,
from: 'foo',
to: 'bar',
}
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.