rave-load-jsx

0.4.0 • Public • Published

rave-load-jsx

Adds jsx file loading to rave.js based on the file extension.

By default, rave-load-jsx loads files with the .jsx extension and compiles the jsx syntax to JavaScript on the fly in the browser. It's only recommended to use this loader for development only. In production you should precompiled all of the jsx files. (How to coming soon).

Usage

First install it into your rave project via:

npm install --save rave-load-jsx

For CommonJS/node-formatted modules (or AMD-wrapped CommonJS):

var MyComponent = require('./my_component.jsx');
// ...
React.renderComponent(<MyComponent />, document.body);

For classic AMD modules:

define(['./my_component.jsx'], function (MyComponent) {
  // ...
  React.renderComponent(<MyComponent />, document.body);
});

For ES6-formatted modules:

import MyComponent from './my_component.jsx';
// ...
React.renderComponent(<MyComponent />, document.body);

Package Sidebar

Install

npm i rave-load-jsx

Weekly Downloads

0

Version

0.4.0

License

MIT

Last publish

Collaborators

  • kidkarolis