Static JSX webpack plugin
Use React JSX as entrypoints in webpack and render them to static HTML!
Inspired by:
- https://github.com/unbroken-dome/indexhtml-webpack-plugin
- https://github.com/markdalgleish/react-to-html-webpack-plugin
- https://github.com/markdalgleish/static-site-generator-webpack-plugin
Usage
webpack.config.js
var StaticJsxPlugin = ; moduleexports = target: 'web' entry: './index.jsx' output: path: 'dist' filename: 'bundle.js' module: loaders: test: /\.$/ // You're gonna need a JSX loader. exclude: /node_modules/ // Babel (babeljs.io) is recommended. loader: 'babel' plugins:
Configuration
title: 'Hello world' // Properties for the React component. beautify: true // Optional, requires js-beautify. You can // also pass an object with js-beautify options.