Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

jsx-webpack-loader

cgeorg43ISC0.1.2

Webpack loader for jsx-transform

webpack, jsx, jsx-transform

readme

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