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(variant-group): hmr in vite #3741

Merged
merged 11 commits into from May 13, 2024
3 changes: 2 additions & 1 deletion packages/shared-integration/src/transformers.ts
Expand Up @@ -40,7 +40,8 @@ export async function applyTransformers(
}

if (code !== original) {
ctx.affectedModules.add(id)
// Investigate if this is safe to remove: https://github.com/unocss/unocss/pull/3741
// ctx.affectedModules.add(id)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems that this line of code is not needed. It will cause additional updates. For example, I modified file a, but multiple files may be added to the change list for the first time. Modification of file a will cause hot updates of all files. uno.css is also updated multiple times. If the a file changes, you should only need to initiate the hot update of the a file and the hot update of uno.css.

antfu marked this conversation as resolved.
Show resolved Hide resolved
return {
code,
map: remapping(maps, (_, ctx) => {
Expand Down