@macaron-elements/compiler
v0.3.0
Published
Macaron compiler
Downloads
3
Readme
The Macaron compiler library and command-line interface
This library / CLI is the compiler that converts Macaron files to Web Components.
Installation
npm install -g @macaron-elements/compiler
Usage
# compile to src/*.js
macaron src/*.macaron
# compile to src/*.js and watches for changes
macaron --watch src/*.macaron
# compile to dist/*.js
macaron --output=dist src/*.macaron
macaron [options] <file paths or glob pattern>
| Option | Description | | ------------ | --------------------------------------------------------------- | | --watch | Watch for changes and re-generate the component. | | -o, --output | Output directory. Defaults to the parent directory of the input |
Help
macaron help
API
import { compile } from "@macaron-elements/compiler";
const data = fs.readFileSync("src/test.macaron", "utf-8");
const out = compile(data);
fs.writeFileSync("src/test.js", out);