/simple-react-webpack-static-plugin

A Webpack plugin which takes entry-point jsx files and generates static html pages they can load into

Primary LanguageJavaScript

simple-react-webpack-static-plugin

Build Status

This plugin creates an HTML file with static markup from each JSX entry-point in a webpack config. It expects you have written your application to use ES-2015.

Example Usage

webpack.config.js

var SimpleReactWebpackStaticPlugin = require('simple-react-webpack-static-plugin');

module.exports = {
  entry: {
    index: './path/to.jsx'
  },

  plugins: [
    new SimpleReactWebpackStaticPlugin({
      "default": {
        "title": "The title for your website"
      },
    })
  ]
};

Interface

  • SimpleReactWebpackStaticPlugin Arguments
    • pages (object) Required [Configuration for page templates, contains keys matching the names of each entry point in your webpack config and a default]
      • default (object) Required [Template variables]
        • title (string) Required for default template [Page title]
  • options (object) Optional template (string) Optional [An override function which returns a template sting] ignore-extensions (array) Optional [File extensions for NodeJs to ignore when reading your modules. This is useful if you are using webpack loaders to load non-javascript files]