@cyrene/compiler
v1.0.0-beta.2
Published
Compiler for .cyr single-file components — 5-phase pipeline with DCE, constant folding, and scoped CSS
Maintainers
Readme
@cyrene/compiler
Compiles .cyr single-file components to JavaScript. You usually don't call
this directly — @cyrene/vite-plugin-cyr
runs it for you during a build. Install it directly only if you're writing your
own tooling.
npm install -D @cyrene/compiler@betaimport { compileCyr } from "@cyrene/compiler";
const { code, map } = compileCyr(source, { filename: "Counter.cyr" });The pipeline is five phases — tokenize, parse, analyze, validate, codegen — plus
constant folding, dead-code elimination, and scoped-style handling. Single-root
components compile to a hoisted <template> + cloneNode path rather than
h() calls, which is what makes compiled .cyr mount and update fast. Source
maps are emitted via magic-string.
It has no runtime dependency on @cyrene/core — it's build-time only.
Docs: https://www.cyrenejs.com · MIT licensed.
