fix(rolldown_plugin_vite_resolve): align bare import logic#5247
fix(rolldown_plugin_vite_resolve): align bare import logic#5247
Conversation
✅ Deploy Preview for rolldown-rs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Benchmarks Rust |
511caf4 to
f74a8ec
Compare
|
What was the concrete resolution difference? Which id + importer was resolved to what previously and what will be resolved to, by this PR? |
if ret.is_some() {
if args.specifier == "element-plus/es/components/button/style/css" {
println!("{:?} {:?}", args.importer, ret);
}
return Ok(ret);
}In both of the following results, specifier: "element-plus/es/components/button/style/css"
importer: "D:/shulaoda/rolldown-vite-test/packages/app/src/App.vue",
ret -> HookResolveIdOutput {
id: "D:/shulaoda/rolldown-vite-test/node_modules/.pnpm/element-plus@2.10.2_vue@3.5.17/node_modules/element-plus/es/components/button/style/css.mjs",
external: None,
normalize_external_id: None,
side_effects: Some(
False,
),
}specifier: "element-plus/es/components/button/style/css"
importer: "D:/shulaoda/rolldown-vite-test/packages/app/src/login.vue",
ret -> HookResolveIdOutput {
id: "D:/shulaoda/rolldown-vite-test/node_modules/.pnpm/element-plus@2.10.2_vue@3.5.17/node_modules/element-plus/es/components/button/style/css.mjs",
external: None,
normalize_external_id: None,
side_effects: Some(
False,
),
} |
|
It seems the sideEffects field was not handled correctly. I made a fix at #5250 |
…Effects field (#5250) closes vitejs/rolldown-vite#288, #5247 Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>

closes vitejs/rolldown-vite#288
Since I'm not very familiar with the related logic, I provided a quick workaround. We don't necessarily have to merge it — it's just to help you understand where the issue lies. @sapphi-red cc
The root cause is that we didn't align with the logic in resolve.ts. Specifically, we're missing the
tryResolveBrowserMappingandtryNodeResolvelogic. In this issue, it hits thetryNodeResolvebranch, which leads to the problem.The integration of rolldown-vite is as follows: