tivac/modular-css

v23 doesn't replace multiple invalid {css.key} entries

Closed this issue · 0 comments

tivac commented

Expected Behavior

If there's more than one {css.key} value that doesn't exist they should be replaced

Current Behavior

Only the first is replaced

Possible Solution

new RegExp(`(${missed.map((ref) => escape(ref)).join("|")})`),

Needs to have the g flag set so it can match multiple times.

Steps to Reproduce (for bugs)

  1. Create a template with multiple <div class="{css.key}" /> entries where key is different each time
  2. Run it
  3. Notice that only the first has been updated

Context

Trying to add new components and rough-in classnames still causes JS explosions

Your Environment

Executable Version
modular-css v23.0.0
npm --version 6.9.0
node --version 10.12.0