static-jsx-webpack-plugin

0.1.0-alpha.4 • Public • Published

Static JSX webpack plugin Build Status npm

Use React JSX as entrypoints in webpack and render them to static HTML!

Inspired by:

Usage

webpack.config.js

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

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.

Readme

Keywords

Package Sidebar

Install

npm i static-jsx-webpack-plugin

Weekly Downloads

1

Version

0.1.0-alpha.4

License

MIT

Last publish

Collaborators

  • mfellner