babel-plugin-react-templates-runtime
Import your React Templates with Babel for server side rendering without save temp file. Idea is taken from https://github.com/arbolista-dev/babel-plugin-react-templates
Installation
$ npm install babel-plugin-react-templates-runtime --save-dev
Usage
Options
Plugin options are passed to reactTemplates.convertTemplateToReact
.
There is also an ext
option for you to specify the extension you want to be compiled by React Templates (the default is rt.html
).
.babelrc
.babelrc
This plugin does requires Babel ES2015 preset.
Examples
This Babel plugin requires you to import your template dependencies BEFORE your templates. For example,
; Component // ... { return template; } // ...
OR
let template = ; Component // ... { return template; } // ...