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(dev): Prevent stripping query params from CSS in HMR #6589

Merged
merged 3 commits into from
Jan 26, 2022

Conversation

matthewp
Copy link
Contributor

Description

During HMR, this change prevents query params from being stripped when
reloading the CSS.

Additional context

None

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.

During HMR, this change prevents query params from being stripped when
reloading the CSS.
@matthewp
Copy link
Contributor Author

Looks like a couple of other tests need updating, fixing now.

@matthewp
Copy link
Contributor Author

This is ready for review.

@patak-dev
Copy link
Member

Looks good @matthewp. I pushed a change as it was easier to avoid going through the GitHub suggest dance in this one. I updated the test so we don't need to add a new client message vite:afterUpdate:css. If this event is important to you, it would be good to create a new feature request or PR to discuss.

@patak-dev patak-dev merged commit 3ab96c6 into vitejs:main Jan 26, 2022
@matthewp
Copy link
Contributor Author

@patak-dev nope, I only created that event for the test. Your way works too, thanks!

@matthewp matthewp deleted the css-preserve-params branch January 26, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants