Skip to content

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Apr 11, 2025

Description

Currently re-export's __vite_ssr_import__ position is preserved at the original code as it uses defineImport(node.start, ...). I replaced it with defineImport(hoistIndex, ...), so they'll get hoisted in the same way as normal imports.

This fixes the test case added in #14468 as seen in the snapshot diff.

Additional note: rollup and rolldown's execution order likely work in the same way

@hi-ogawa
Copy link
Contributor Author

/ecosystem-ci run

Copy link

pkg-pr-new bot commented Apr 11, 2025

Open in StackBlitz

npm i https://pkg.pr.new/vite@19841

commit: 02dd3ca

@vite-ecosystem-ci

This comment was marked as outdated.

@hi-ogawa hi-ogawa marked this pull request as ready for review April 11, 2025 06:18
@vite-ecosystem-ci
Copy link

sapphi-red
sapphi-red previously approved these changes Apr 14, 2025
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me 👍

sapphi-red
sapphi-red previously approved these changes Apr 15, 2025
@hi-ogawa hi-ogawa merged commit ed29dee into vitejs:main Apr 23, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: ssr p2-edge-case Bug, but has workaround or limited in scope (priority) trigger: preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wrong execution order with re-export on Vite SSR

2 participants