jsx-require-extension
v0.2.0
Published
A require.extensions loader for JSX files
Downloads
21
Readme
jsx-require-extension
A simple node module to register a require.extensions
loader for JSX files. For more information about JSX, visit Facebook's JSX Specification.
Usage
By simply requiring jsx-require-extension, you can immediately require JSX files.
require( 'jsx-require-extension' );
require( './my-react-component.jsx' );
This module is intended to be used directly in other modules without need for a setup process. For example, you can use it as a Mocha compiler through Mocha's --compilers
flag:
$ mocha --compilers jsx:jsx-require-extension
Lastly, if you want to pass flags, you can instead require the corresponding file found in the options
directory:
require( 'jsx-require-extension/options/harmony' );
Versioning
Use the following table to determine which version of jsx-require-extension works with your version of React.
| React | jsx-require-extension | |-------|-----------------------| | 0.1.x - 0.11.x | 0.1 | | 0.12.x+ | 0.2 |
License
Copyright (c) 2014 Automattic, Inc.
Released under the MIT License.