Skip to content

replace plugin. default "delimiters" value is breaking for developers #905

Closed

Description

@o-alexandrov
  • Rollup Plugin Name: @rollup/plugin-replace
  • Rollup Plugin Version: 2.4.2 (currently latest)
  • Rollup Version: 2.50.6
  • Operating System (or Browser): macos (but it's irrelevant in this case)
  • Node Version: 16 (but it's irrelevant in this case)
  • Link to reproduction: a PR fix(replace)!: issues with nested objects replacements #903

Actual Behavior

Currently, developers have issues with replacements w/ nested access.
If you attempt to replace typeof window with "object", you would see the following scenarios:

  • typeof window will be replaced
  • typeof window.document will be replaced, resulting in "object".document (which is an error)
  • typeof windowSmth will not be replaced due to a \b boundary

Expected Behavior

  • typeof window.document will NOT be replaced, resulting in "object".document (which is an error)

Activity

  1. o-alexandrov commented on Jun 15, 2021

    @o-alexandrov
    ContributorAuthor

    Closing per this comment #903 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions