We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I am trying to use this library via its CLI.
"scripts": { ... "replace": "replace-in-file --configFile=replace-config.js" }
My config file looks like this:
const replace = require('replace-in-file'); const options = { files: '/sitemap.xml', from: /\?>$/, to: `?> <?xml-stylesheet type="text/xsl" href="/sitemap-template.xsl"?> `, }; replace(options);
However, when running that I receive an error.
throw new Error('Must specify string or regex to replace');
Whether I provide a regex or string in the from property, I continue to receive the error. Am I doing something wrong in the config file?
from
The text was updated successfully, but these errors were encountered:
Found my answer here: #37
Sorry, something went wrong.
Yep, I reckon the issue was that the configuration file wasn't exporting a JSON/JS object? 👍
No branches or pull requests
Hello,
I am trying to use this library via its CLI.
My config file looks like this:
However, when running that I receive an error.
Whether I provide a regex or string in the
from
property, I continue to receive the error. Am I doing something wrong in the config file?The text was updated successfully, but these errors were encountered: