@builder.io/mitosis-cli
TypeScript icon, indicating that this package has built-in type declarations

0.12.0 • Public • Published

Mitosis CLI

A CLI for Mitosis.

Installation

npm install -g @builder.io/mitosis-cli

Usage

mitosis compile --to=<format> < <input-file>
cat my-file.tsx | mitosis compile -t=<format>
mitosis compile -t=<format> <input-file>

Check the output from mitosis compile --help.

Examples

mitosis compile -t react component.tsx
mitosis compile -t react < component.tsx
cat component.tsx | mitosis compile -t html -
mitosis compile -t react --out-dir build -- src/**/*.tsx

Options

Supported formats for --to are:

  • reactNative
  • solid
  • vue
  • react
  • template
  • html
  • customElement
  • mitosis
  • builder
  • swift
  • svelte
  • liquid
  • angular

Supported formats for --from are:

  • mitosis
  • builder
  • liquid

Cook book

Here are some recipes for standard tasks

Validate how Builder will transform Mitosis

cat components/postscript.lite.tsx |
  mitosis compile -t builder - |
  mitosis compile -f builder -t mitosis

Run mitosis on file system change

Use a tool like entr or guard

find . -name '*lite.tsx' | entr make /_

Known issues

  • Running mitosis from the root of this repository breaks due to some dynamic babel configuration look up
  • Files that are created as the result of --out-dir=<dir> maintain the original file extension of the input file, which doesn't make any sense in the case of an html output.
  • --out=<file> does not support concatenating multiple files together.

Readme

Keywords

none

Package Sidebar

Install

npm i @builder.io/mitosis-cli

Weekly Downloads

1,698

Version

0.12.0

License

MIT

Unpacked Size

151 kB

Total Files

37

Last publish

Collaborators

  • steve8708
  • samijaber
  • teleaziz123
  • mrkoreye
  • strd6
  • mhevery
  • adamdbradley
  • gustavohgs
  • manucorporat
  • shyam-builder
  • sanyamkamat
  • harmeet.builder
  • midhunadarvin
  • kylefowler
  • builderio-bot
  • armela
  • anaghavarhade
  • sidmohanty11
  • yash-wadhia-builder
  • paprikaf
  • clyde-builderio