OpenSourceRaidGuild / babel-vite

babel preset and plugins that emulate Vite's non-standard functionality
MIT License
57 stars 12 forks source link

Support `import.meta.hot` #3

Closed mpeyper closed 1 year ago

mpeyper commented 3 years ago

Describe the feature you'd like:

As part of looking at #1, I discovered the Vite has another piece of import.meta functionality that we aren't supporting yet: import.meta.hot.

Link to docs.

Suggested implementation:

I think we would be pretty safe to simply remove any references to it as in most cases we are transforming for test code where HMR is not applicable (AFAIK) and/or environments where HMR is not available or available through different APIs.

As per the other transforms, it should be able to be disabled from the preset so other babel plugins could handle it in specialised ways or it can be left in if the target environment supports it.

Describe alternatives you've considered:

None.

Teachability, Documentation, Adoption, Migration Strategy:

neoighodaro commented 2 years ago

Hello, would this be possible?

mpeyper commented 2 years ago

Hi @neoighodaro, sorry for the delayed response.

I haven't looked into it at all since raising it, but as usual PRs are always welcome. Would you be interested in adding this feature?