Skip to content

fix(sourcemap): don't warn even if the sourcesContent is an empty string#16273

Merged
patak-cat merged 1 commit intovitejs:mainfrom
sapphi-red:fix/sourcemap-dont-warn-if-content-is-empty
Mar 26, 2024
Merged

fix(sourcemap): don't warn even if the sourcesContent is an empty string#16273
patak-cat merged 1 commit intovitejs:mainfrom
sapphi-red:fix/sourcemap-dont-warn-if-content-is-empty

Conversation

@sapphi-red
Copy link
Copy Markdown
Member

Description

If sourcesContent[i] is an empty string, Vite showed an warning that the sourcemap points to missing source files. But if it's an empty string, it means that the content is empty rather than the content should be read from the file placed there.

For example, this happens when the library is built with esbuild and uses define (esbuild try). You can see <define:_FOO_> has '' as a content.

Additional context


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, especially the Pull Request Guidelines.
  • 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).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

Loading
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

Development

Successfully merging this pull request may close these issues.

2 participants