v0.3.0
What's new
transform/3
- Source maps —
OXC.transform(code, file, sourcemap: true)returns%{code: ..., sourcemap: ...}with a v3 source map - Target downleveling —
OXC.transform(code, file, target: "es2019")lowers syntax features (e.g. nullish coalescing → ternary) - JSX import source —
OXC.transform(jsx, file, import_source: "vue")usesvue/jsx-runtimeinstead ofreact/jsx-runtime - JSX factory/fragment —
OXC.transform(jsx, file, jsx: :classic, jsx_factory: "h", jsx_fragment: "Fragment")
bundle/2
- Target downleveling —
OXC.bundle(files, target: "es2020") - JSX import source —
OXC.bundle(files, import_source: "vue") - JSX factory/fragment — same options as transform
imports/2
Fast NIF-level import specifier extraction — skips full AST serialization. Type-only imports are excluded automatically.
{:ok, ["vue", "preact"]} = OXC.imports("import { ref } from 'vue'\nimport { h } from 'preact'", "test.ts")