1.1.5 • Published 3 years ago
unreact-ejs v1.1.5
Node.js v8 or newer is required.
Via the yarn client:
$ yarn add --dev unreact
Via the npm client:
$ npm install --save-dev unreact
Convert Files (--out-file
/-o
)
unreact src/button.js --out-file views/button.pug
Convert Directories (--out-dir
/-O
)
unreact src --out-dir views
Template Engine (--template-engine
/-t
)
Default option is pug
, you can also choose ejs
.
unreact src/button.js --out-file views/button.ejs --template-engine ejs
unreact src --out-dir views -t ejs
Add string to the beginning of the output file (--add-beginning
)
unreact src/main.js --out-file views/main.pug --add-beginning "include header.pug"
Add string to the ending of the output file (--add-ending
)
unreact src/main.js --out-file views/main.pug --add-ending "include footer.pug"
Change initial indent level (--initial-indent-level
)
unreact src/main.js --out-file views/main.pug --initial-indent-level 1
ALPHA: things may not work
- Only works with functional components and very simple ones.
Check the work bridging React and Prepack: