npm.io
5.43.3 • Published 3d ago

@marko/compiler

Licence
MIT
Version
5.43.3
Deps
0
Vulns
0
Weekly
0
Stars
14.5K

@marko/compiler

Compiles Marko templates into JavaScript modules.

The bundler integrations call the compiler for every template, so applications rarely use it directly. It is the API for building a bundler integration, a test transform, or other tooling around Marko templates.

npm install @marko/compiler
import * as compiler from "@marko/compiler";

const { code, map } = await compiler.compileFile("./src/card.marko", {
  output: "dom",
  sourceMaps: true,
});

See the Compiler API reference for the compile functions, their options and the compile result.

Keywords