Skip to content

Only replaces first match in file #10

@anthonator

Description

@anthonator

Only replaces the first instance of the matched item in a file.

{
  replacements: [
    {
      pattern: /process\.env\.[A-Z\d_]+/,
      replacement: function(match, p1, offset, string) {
        return process.env[match.replace(/process\.env\./, '')];
      }
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions