0.1.0-alpha.4 • Published 9 years ago

static-jsx-webpack-plugin v0.1.0-alpha.4

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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.