Rewrites ESM syntax to function calls
MIT License
Rewrites ESM syntax to function calls, so they can be evaluated without ESM context. Ported from Vite's ssrTransfrom but as a Babel plugin.
// input
import { ref } from 'vue'
function foo() {
return ref(0)
}
// output
const __esm_import_0__ = await __esm_import__('vue')
function foo() {
return __esm_import_0__.ref(0)
}
MIT License © 2022 Anthony Fu