Search code examples
semantic-release

Does semantic-release have a replacer to replace a string in a file?


I was surprised not to see a plugin for semantic-release to do replacing of strings (e.g., by regex) within files, e.g., to update the version string in a service-worker (as well as README).

Does semantic-release have such a feature or plugin?


Solution

  • There is no official plugin to do that. You can use a npm script or @semantic-release/exec to run a script that do the replacement during the prepare step.

    See How can I use a npm build script that requires the package.json’s version ?.