Rename '@hmr' to 'vite/hmr' (fixes #92)
- Rename module
@hmr
tovite/hmr
- Alias
@hmr
asvite/hmr
and deprecate it (or is backwards-compat not a priority in >1.0.0?)
Thanks for the idea and the PR!
So - the public interface of the HMR API and the internal one is actually different. To make it easier to use, the server will auto inject necessary strings to it. e.g.
hot.accept('./foo.js', () => {})
Will be transformed to
// the file's own public path is injected, and deps are also normalized to absolute paths
hot.accept('/foo/bar.js', '/foo/foo.js', () => {})
We can simply ship a separate hmr.d.ts
in the root without creating a separate directory for it. See eab49a4