1.0.1 • Published 5 years ago
@jsx-lite/cli v1.0.1
JSX-Lite CLI
A CLI for jsx-lite.
Installation
npm install -g @jsx-lite/cliUsage
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/**/*.tsxOptions
Supported formats for --to are:
reactNativesolidvuereacttemplatehtmlcustomElementjsxLitebuilderswiftsvelteliquidangular
Supported formats for --from are:
jsxLitebuilderliquid
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 jsxLiteRun jsx-lite on file system change
find . -name '*lite.tsx' | entr make /_Known issues
- Running
jsx-litefrom 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 git@github.com:BuilderIO/jsx-lite.git
cd jsx-lite/packages/cli
npm install
npm run build
npm linkLicense
MIT - see LICENSE