@inflector/keeno-compiler
v0.9.0
Published
Compiler for Keeno (.kn) single-file components
Readme
@inflector/keeno-compiler
Compiles Keeno .kn single-file components to JavaScript and scoped CSS. Apps don't use it directly: @inflector/vite-plugin-keeno runs it for you.
import { compile } from '@inflector/keeno-compiler'
const { js, css, map, scope, name } = compile(source, { filename: 'src/Counter.kn' })filenameis used for the scope hash, the component name, error messages and source maps. Pass a path relative to the project root, so that hashes are the same on every machine.jsis TypeScript when the component's script is (<script lang="ts">). Strip the types before running it.- Compile errors are thrown with a code frame and a
loc.
The shape of the output is not part of the public API. See Tooling. MIT license.
