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 hot.accept() module resolution #97

Merged
merged 5 commits into from
May 9, 2020
Merged

Fix hot.accept() module resolution #97

merged 5 commits into from
May 9, 2020

Conversation

bates64
Copy link
Contributor

@bates64 bates64 commented May 8, 2020

@yyx990803
Copy link
Member

This can use this util - it was created to fix a similar bug but I forgot to use it in the registerDep function 😅

The following are equivalent, given the importer is in the `/src/` directory:

```
hot.accept('./foo.js', cb)
hot.accept('/src/foo.js', cb)
```
@bates64
Copy link
Contributor Author

bates64 commented May 8, 2020

Will do!
(By the way, it looks like you depend on resolve-from but the dependency goes unused.)

Note that this has a side-effect of allowing you to hot.accept() an _external node module_. I'm not sure why anyone would ever do this, but it's supported.
@bates64 bates64 marked this pull request as ready for review May 8, 2020 23:21
@bates64
Copy link
Contributor Author

bates64 commented May 8, 2020

This is done 🎉 I'd suggest squashing these commits.

@yyx990803 yyx990803 merged commit 7ffa9c0 into vitejs:master May 9, 2020
@bates64 bates64 deleted the fix-hmr-accept branch May 9, 2020 01:06
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.

HMR doesn't accept local paths
2 participants