Commit 2fcf7f3
fix(@formatjs/unplugin): strip query/hash in transformInclude (#6465)
## Summary
- React Router splits routes that export `clientLoader`/`clientAction`
into virtual chunk modules with IDs like `route.tsx?route-chunk=main`.
The plain `\.[jt]sx?$` test in `transformInclude` rejected those, so
`defineMessage` calls in those chunks never got their `id` injected
during production builds.
- Strip `?…` and `#…` off the id before the extension check.
- Added a regression test covering query-string and hash IDs (and the
negative `node_modules` case with a query).
Fixes #6455
## Test plan
- [x] `bazel test //packages/unplugin/...` — all tests pass, including
the new regression case
- [ ] CI green
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>1 parent cff6ade commit 2fcf7f3
2 files changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
521 | 536 | | |
522 | 537 | | |
523 | 538 | | |
| |||
0 commit comments