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: missing styles with build watch (#3742) #3887

Merged
merged 1 commit into from
Jun 24, 2021
Merged

Conversation

janispritzkau
Copy link
Contributor

Description

Fixes issue #3742 by preventing the styles cache from being reset in the vite:css-post plugin on buildStart. This is necessary because already built styles will not be included in subsequent builds, since the function transform will not be called again (where the styles are cached).

Additional context

Maybe there are better ways to solve this without having to cache everything forever.


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.

@janispritzkau
Copy link
Contributor Author

janispritzkau commented Jun 21, 2021

I overlooked the PR that already existed. #3747

@janispritzkau
Copy link
Contributor Author

janispritzkau commented Jun 21, 2021

Apart from that, mine contains the hasEmitted fix, which fixes a slightly different problem.

I think it's this one: #3566

@patak-dev
Copy link
Member

Thanks for the PR @janispritzkau, let's first merge #3747 that was already reviewed, and we can see then if something is missing. In the meantime, if you want to help test it, and maybe add a test case to your PR that is not going to pass with #3747 that would be good.

@patak-dev
Copy link
Member

Ok, I saw now that there were enough approvals to merge it. Could you merge main against this PR and add a failing test for the bits that are not covered there? Thanks!

Copy link
Member

@antfu antfu left a comment

Choose a reason for hiding this comment

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

Tested locally and confirmed the fix. Thanks!

@antfu antfu merged commit c9a6efe into vitejs:main Jun 24, 2021
aleclarson pushed a commit to aleclarson/vite that referenced this pull request Nov 8, 2021
@j
Copy link

j commented Apr 8, 2022

@antfu @patak-dev I'm not getting refreshes working in lib mode...

@patak-dev
Copy link
Member

@j please create a new issue with a minimal reproduction. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants