Skip to content

Instantly share code, notes, and snippets.

@pomber
Created June 5, 2024 10:04
Show Gist options
  • Save pomber/7dbadddd7401bb1a1814769f20319ea4 to your computer and use it in GitHub Desktop.
Save pomber/7dbadddd7401bb1a1814769f20319ea4 to your computer and use it in GitHub Desktop.
Recma debugger plugin
import fs from "node:fs"
import { jsx, toJs } from "estree-util-to-js"
function recmaPlugin() {
return (tree) => {
const result = toJs(tree, { handlers: jsx })
fs.writeFileSync("recma.jsx", result.value)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment