Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(vite): improve vite-node hmr #6343

Merged
merged 6 commits into from
Aug 4, 2022
Merged

fix(vite): improve vite-node hmr #6343

merged 6 commits into from
Aug 4, 2022

Conversation

antfu
Copy link
Member

@antfu antfu commented Aug 4, 2022

๐Ÿ”— Linked issue

close nuxt/nuxt#14469

โ“ Type of change

  • ๐Ÿ“– Documentation (updates to the documentation or readme)
  • ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • ๐Ÿ‘Œ Enhancement (improving an existing functionality like performance)
  • โœจ New feature (a non-breaking change that adds functionality)
  • โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

This PR implemented the full HMR support of vite-node as mentioned in #6154 (comment)

Re nuxt/nuxt#14469, the bug is caused because in the release build, entry.mjs is laying under node_modules which bypasses the cache clear up due to #6153

๐Ÿ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented Aug 4, 2022

โœ… Deploy Preview for nuxt3-docs canceled.

Name Link
๐Ÿ”จ Latest commit 69a22e5
๐Ÿ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62eb9543212a070008183d0e

packages/vite/src/runtime/vite-node.mjs Outdated Show resolved Hide resolved
packages/vite/src/runtime/vite-node.mjs Outdated Show resolved Hide resolved
packages/vite/src/vite-node.ts Outdated Show resolved Hide resolved
antfu and others added 3 commits August 4, 2022 16:06
Co-authored-by: Damian Gล‚owala <48835293+DamianGlowala@users.noreply.github.com>
Co-authored-by: Damian Gล‚owala <48835293+DamianGlowala@users.noreply.github.com>
Co-authored-by: Damian Gล‚owala <48835293+DamianGlowala@users.noreply.github.com>
@pi0
Copy link
Member

pi0 commented Aug 4, 2022

This is nice solution <3

Locally trying on an external project (MacOS), Server HMR seems perfectly working but only we are invalidating some unnecessary chunks. Which could be probably improved later.

image

@pi0 pi0 changed the title fix(vite-node): improve vite-node HMR fix(vite): improve vite-node hmr Aug 4, 2022
@pi0 pi0 merged commit 972f4b4 into main Aug 4, 2022
@pi0 pi0 deleted the fix/vite-node-hmr branch August 4, 2022 10:03
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vite-node server HMR is broken
4 participants