Package Exports
- @marko/compile
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@marko/compile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@marko/compile
Utility to compile Marko templates to JavaScript.
CLI
Getting Started
npm install @marko/compile
marko-compile template.markoor
npx @marko/compile template.markoExample
marko-compile --server ./components/my-component.marko
marko-compile --browser ./components/my-component.markoOptions
--server: Compiles a Marko file to render html.--browser: Compiles a Marko file to render vdom.--files --file -f *: Provide a pattern to match marko file(s).--ignore: Provide a pattern to exclude files from being compiled.--clean: Deletes any compiled.marko.jsfiles.
API
Installation
npm install @marko/compileExample
import compile from "@marko/compile";
compile({
files: "./components/**/*.marko"
}).then(() => {
// All files are written to disk.
console.log("Compiled all files");
});Options
Options are the same as the CLI options.