0.3.0 • Published 4 years ago
@macaron-elements/compiler v0.3.0
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/compilerUsage
# 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/*.macaronmacaron [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 helpAPI
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);