ITADN

Incorrect output when using vite 8

#520Opena92126 创建于 2026-04-08
bug
A
a92126commented
### Environment Vue project with unplugin-auto-import, with vite 8, unplugin-auto-import with includes: ["vue"]. ### Reproduction Using default configuration with rolldown, giving codes below: ```js const v = ref() function foo(){ const ref = JSON.parse("{}"); return ref; } ``` And then in the output bundle, the symbol `ref` in package vue will be stripped. ### Describe the bug The reason for the bug is when processing codes in `detectImportsRegex`, expression `const ref = ...` inside `foo` will match excludeRE and be removed from `occurrenceMap`. It wont happend with esbuild, which will give the output `const ref2 = ...` to avoid name conflict. ### Additional context _No response_ ### Logs ```sh ```
0 条评论