https://github.com/mfellner/static-jsx-webpack-plugin
Render JSX to static HTML with webpack
https://github.com/mfellner/static-jsx-webpack-plugin
Last synced: about 1 month ago
JSON representation
Render JSX to static HTML with webpack
- Host: GitHub
- URL: https://github.com/mfellner/static-jsx-webpack-plugin
- Owner: mfellner
- License: mit
- Created: 2015-08-30T17:26:06.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-17T20:25:36.000Z (over 9 years ago)
- Last Synced: 2025-05-07T17:13:11.069Z (about 1 month ago)
- Language: JavaScript
- Size: 31.3 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Static JSX webpack plugin [](https://travis-ci.org/mfellner/static-jsx-webpack-plugin) [](https://www.npmjs.com/package/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**
```javascript
var StaticJsxPlugin = require('static-jsx-webpack-plugin');module.exports = {
target: 'web',
entry: './index.jsx',
output: {
path: 'dist',
filename: 'bundle.js'
},
module: {
loaders: [{
test: /\.(js|jsx)$/, // You're gonna need a JSX loader.
exclude: /node_modules/, // Babel (babeljs.io) is recommended.
loader: 'babel',
}]
},
plugins: [new StaticJsxPlugin()]
}
```**Configuration**
```javascript
new StaticJsxPlugin(
{
title: 'Hello world' // Properties for the React component.
},
{
beautify: true // Optional, requires js-beautify. You can
}) // also pass an object with js-beautify options.
```