@jsx-lite/cli
v1.0.1
Published
jsx-lite CLI
Downloads
12
Readme
JSX-Lite CLI
A CLI for jsx-lite.
Installation
npm install -g @jsx-lite/cli
Usage
jsx-lite compile --to=<format> < <input-file>
cat my-file.tsx | jsx-lite compile -t=<format>
jsx-lite compile -t=<format> <input-file>
Check the output from jsx-lite compile --help
.
Examples
jsx-lite compile -t react component.tsx
jsx-lite compile -t react < component.tsx
cat component.tsx | jsx-lite compile -t html -
jsx-lite compile -t react --out-dir build -- src/**/*.tsx
Options
Supported formats for --to
are:
reactNative
solid
vue
react
template
html
customElement
jsxLite
builder
swift
svelte
liquid
angular
Supported formats for --from
are:
jsxLite
builder
liquid
Cook book
Here are some recipes for standard tasks
Validate how Builder will transform JSX Lite
cat components/postscript.lite.tsx |
jsx-lite compile -t builder - |
jsx-lite compile -f builder -t jsxLite
Run jsx-lite on file system change
find . -name '*lite.tsx' | entr make /_
Known issues
- Running
jsx-lite
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.
Manual installation
git clone [email protected]:BuilderIO/jsx-lite.git
cd jsx-lite/packages/cli
npm install
npm run build
npm link
License
MIT - see LICENSE