0.1.2 • Published 9 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.createElement
or?jsx=h
. - To ignore doc block, use
?ignoreDocblock
in your loader config. In this case you must also specify the?jsx
option. - Specify
?docblockUnknownTags
to have unknown tag names treated as tags rather than function names. - Specify
?unknownTagsAsString
to have unknown tag names treated as strings rather than names. - Specify
?tagMethods
to 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