Commit 7a0a171
committed
fix: only remove tw/twStyle imports when transformations succeed
Track successful transformations instead of just import detection.
Previously, imports were removed even when tw calls with interpolations
or twStyle calls with dynamic values were skipped, causing runtime
ReferenceError.
Now hasTwImport is only set to true after successful transformation,
ensuring imports are preserved when original expressions remain.1 parent db8158f commit 7a0a171
1 file changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
446 | 448 | | |
447 | 449 | | |
448 | 450 | | |
| |||
459 | 461 | | |
460 | 462 | | |
461 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
462 | 467 | | |
463 | 468 | | |
464 | 469 | | |
| |||
502 | 507 | | |
503 | 508 | | |
504 | 509 | | |
| 510 | + | |
| 511 | + | |
505 | 512 | | |
506 | 513 | | |
507 | 514 | | |
| |||
518 | 525 | | |
519 | 526 | | |
520 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
521 | 531 | | |
522 | 532 | | |
523 | 533 | | |
| |||
0 commit comments