Commit d7349e7
fix(core): prevent /*#__PURE__*/ annotation inside function declarations (#2585)
The pureAnnotationPlugin regex matched `createContext(` inside function
declarations like `function createContext(...)`, inserting the annotation
between the `function` keyword and the name. This caused Rollup/Vite to
emit a warning about uninterpretable annotations.
Added a negative lookbehind `(?<!function\s)` to skip function declarations,
so only actual call sites get annotated.
Fixes #2579
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 5cc56e0 commit d7349e7
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
0 commit comments