Skip to content

Conversation

@smcenlly
Copy link
Contributor

@smcenlly smcenlly commented Apr 5, 2024

Description

fixes #16355

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@sapphi-red sapphi-red added p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) feat: sourcemap Sourcemap support feat: ssr labels Aug 21, 2024
sapphi-red
sapphi-red previously approved these changes Oct 17, 2024
@sapphi-red
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

@hi-ogawa
Copy link
Contributor

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"]});


  "
`)

@sapphi-red
Copy link
Member

I'm running some examples locally and 2nd import doesn't get hoisted?

Thanks, I pushed a commit to fix that.

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Looks great!

@bluwy bluwy changed the title fix: missing source maps for hoisted imports (fix #16355) fix(ssr): preserve source maps for hoisted imports (fix #16355) Oct 24, 2024
@patak-dev patak-dev merged commit 8e382a6 into vitejs:main Oct 24, 2024
15 checks passed
moonlitusun pushed a commit to moonlitusun/vite that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: sourcemap Sourcemap support feat: ssr p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority)

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Source maps missing for hoisted imports for ssrTransforms

5 participants