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(plugin-vue): fix sourcemap when no script block in sfc (close #8601) #8604

Merged
merged 5 commits into from
Jun 16, 2022

Conversation

meteorlxy
Copy link
Contributor

Description

Fixes #8601

Before

When either scriptMap or templateMap is empty, it will cause the entire sourcemap to be empty.

After

Allow either scriptMap or templateMap to be empty.

Additional context

Also remove some redundant type annotations.


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 Commit 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.

@sapphi-red sapphi-red added plugin: vue p3-minor-bug An edge case that only affects very specific usage (priority) labels Jun 15, 2022
@sapphi-red
Copy link
Member

The implementation looks good to me. Could you add a test to playground/vue-sourcemap?

@meteorlxy
Copy link
Contributor Author

Didn't notice we have tests for that. I'll add tests later.

@meteorlxy
Copy link
Contributor Author

@sapphi-red done

@sapphi-red
Copy link
Member

Thanks!

@patak-dev patak-dev merged commit ccfccec into vitejs:main Jun 16, 2022
@meteorlxy meteorlxy deleted the fix/vue-sourcemap branch June 16, 2022 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

[Bug Report] Vue SFC source map is missing when there is no script block
3 participants