-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ssr): preserve source maps for hoisted imports (fix #16355) #16356
Conversation
Run & review this pull request in StackBlitz Codeflow. |
/ecosystem-ci run |
📝 Ran ecosystem CI on
✅ analogjs, histoire, ladle, laravel, marko, nuxt, previewjs, quasar, qwik, rakkas, redwoodjs, storybook, vite-environment-examples, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-swc, vite-plugin-svelte, vite-plugin-vue, vite-setup-catalogue, vitepress, vuepress |
I'm running some examples locally and 2nd import doesn't get hoisted? expect(await ssrTransformSimpleCode(`\
console.log(foo.bar);
console.log(foo2.bar);
import foo from 'libx';
import foo2 from 'liby';
`)).toMatchInlineSnapshot(`
"const __vite_ssr_import_0__ = await __vite_ssr_import__("libx", {"importedNames":["default"]});
console.log(__vite_ssr_import_0__.default.bar);
console.log(__vite_ssr_import_1__.default.bar);
const __vite_ssr_import_1__ = await __vite_ssr_import__("liby", {"importedNames":["default"]});
"
`) |
Thanks, I pushed a commit to fix that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Description
fixes #16355