0.1.2 • Published 11 years ago
jsx-webpack-loader v0.1.2
Webpack loader for JSX-transform
Usage
{..., loader: 'jsx-webpack-loader'}Supported options
- Specify the element constructor by providing
?jsx=...in your loader config. For instance,?jsx=React.createElementor?jsx=h. - To ignore doc block, use
?ignoreDocblockin your loader config. In this case you must also specify the?jsxoption. - Specify
?docblockUnknownTagsto have unknown tag names treated as tags rather than function names. - Specify
?unknownTagsAsStringto have unknown tag names treated as strings rather than names. - Specify
?tagMethodsto have unknown tag names treated as tags rather than function names.
Troubleshooting
- It doesn't work with ES6/babel-loader ** Make babel-loader run first, and tell it not to run the React JSX transform:
loaders: [
{test: /\.js/, exclude: /node_modules/, loader: "jsx-webpack-loader"},
{test: /\.js/, exclude: /node_modules/, loader: "babel-loader?blacklist=react"}
]Credits
Thanks to Alex Mingoia for jsx-transform and Pete Hunt for jsx-loader