fix(hmr): entry mod's importers contains css mod invalidate hmr#3929
fix(hmr): entry mod's importers contains css mod invalidate hmr#3929patak-dev merged 2 commits intovitejs:mainfrom
Conversation
|
Thanks @OneNail - the fix is correct, but the way it is implemented can be a bit difficult to read for future maintainers. I refactored it to be more explicit what case it is handling. |
…js#3929) * fix(hmr): entry mod's importers contains css mod invalidate hmr * Update hmr.ts Co-authored-by: Evan You <yyx990803@gmail.com>
|
If I've well understood the related issues, it seems that this fix aims to full reload the page when a tailwindcss app.css change is triggered by a change in an html file (or similar) this works well quite all the times, but our plugin for livewire hot reload is broken by this (because it triggers a full reload while the client part of the plugin is trying to refresh the single livewire component) is there any way to make this feature opt-in? or will you accept a PR to allowe to disable this in config there are cases where a full reload is not needed (if not detrimental) when app.css is updated by tailwind for reference: https://github.com/def-studio/vite-livewire-plugin/discussions/12 |
|
@fabio-ivona please open a new issue |
Description
fix #3913 #3716
HMR is not working as change entry javascript file or index.html
Additional context
entry file
main.js:index.css:@tailwind base;hmr is not working as change the
main.js, the client receive the error update message -hmr update index.cssPostCSS plugin Tailwind JIT register any file as a dependency to a CSS file. Although
main.jsis an entry file,main.jsmodule's importers includesindex.cssmodule. Through thepropagateUpdatefunction, get the wrong result thatindex.cssneeds to be updated.vite/packages/vite/src/node/server/hmr.ts
Line 212 in f623ba3
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).