cgeorg/jsx-transform-loader
Webpack loader for jsx-transform
{ "createdAt": "2015-03-16T21:42:20Z", "defaultBranch": "master", "description": "Webpack loader for jsx-transform", "fullName": "cgeorg/jsx-transform-loader", "homepage": null, "language": "JavaScript", "name": "jsx-transform-loader", "pushedAt": "2015-06-25T20:46:24Z", "stargazersCount": 3, "topics": [], "updatedAt": "2015-11-07T09:24:19Z", "url": "https://github.com/cgeorg/jsx-transform-loader"}Webpack loader for JSX-transform
Section titled “Webpack loader for JSX-transform”Install:
npm install --save-dev jsx-webpack-loaderThen, in your webpack config:
{..., loader: 'jsx-webpack-loader'}Supported options
Section titled “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
Section titled “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
Section titled “Credits”Thanks to Alex Mingoia for jsx-transform and Pete Hunt for jsx-loader