Skip to content
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(sourcemap): preserve original sourcesContent #13662

Merged
merged 2 commits into from
Jul 3, 2023

Conversation

sun0day
Copy link
Member

@sun0day sun0day commented Jun 28, 2023

Description

Additional context

  • excludeContent needs to be false unconditionally to pass sourcesContent all along the way.

    • Personally, I think there is no need to include the source content when source file exists. But we could exclude it for now in 4.4 beta to see how it works.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@stackblitz
Copy link

stackblitz bot commented Jun 28, 2023

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

@sun0day
Copy link
Member Author

sun0day commented Jun 28, 2023

@sapphi-red cc

@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) feat: sourcemap Sourcemap support labels Jun 29, 2023
@sapphi-red sapphi-red changed the title fix(sourcemap): optimize injectSourcesContent fix(sourcemap): preserve original sourcesContent Jun 29, 2023
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.

Thank you!
I tested this PR on some issues' reproductions and added the results on the OP.

@sapphi-red
Copy link
Member

Personally, I think there is no need to include the source content when source file exists.

We need to include it for now. If we exclude it, the browser will fetch the content. But because Vite cannot differentiate that request and a normal JS import request, Vite returns a transformed request. This results in showing a transformed file as a original source (related: #13391).

@patak-dev
Copy link
Member

Let's merge it and do one more beta patch before releasing 4.4. cc @bmeurer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: sourcemap Sourcemap support p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
3 participants