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): properly select the main module during hot update (fix #4150) #4261

Closed
wants to merge 1 commit into from

Conversation

paraboul
Copy link
Contributor

@paraboul paraboul commented Jul 15, 2021

fix #4150

Description

moduleGraph contains 2 entries for the SFC being updated :

  • One with index.css as the only importer (because Tailwind JIT tells that every purgeable files are a deps of the generated css (index.css)).
  • Another one with the "right" importer (the parent component or the js file where the component is imported).

This fix tries to better select the "main module" being selected during handleHotUpdate by selecting one with an id set.

Additional context

I'm not super familiar with the code and so, i'm not 100% if there are legit cases where id property is missing


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.

@Shinigami92 Shinigami92 added bug p4-important Violate documented behavior or significantly improves performance (priority) labels Jul 15, 2021
@paraboul
Copy link
Contributor Author

paraboul commented Jul 15, 2021

Ok closing, after further testing, it seems that it's not properly propagating updates to index.css when introducing a new inlined tailwind classe in the affected module.

@paraboul paraboul closed this Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4-important Violate documented behavior or significantly improves performance (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vite + router + tailwind JIT -> full page reload
2 participants