react-router-html-webpack-plugin

0.2.1 • Public • Published

react-router-html-webpack-plugin

npm version npm downloads Travis Codecov semantic-release Commitizen

This is a work in progress and hasn't been implemented yet!!!

It will not work as intended!!!

Installation

Install the plugin with npm:

$ npm install react-router-html-webpack-plugin --save-dev

Basic Usage

Basic usage copies HTML Webpack Plugin:

var ReactRouterHtmlWebpackPlugin = require('react-router-html-webpack-plugin');
var webpackConfig = {
  // ...
  plugins: [
    // ...
    new ReactRouterHtmlWebpackPlugin(),
    // ...
  ],
  // ...
};

Configuration

You can pass a hash of configuration options to ReactRouterHtmlWebpackPlugin, exactly like HTML Webpack Plugin. Allowed values are the same except for some differences:

  • routes: The routes file to generate routes from. Ignores routes and acts exactly like HTML Webpack Plugin when omitted.
  • filename: For each route, the file to write the HTML to. Defaults to ['[route].html', '[route]/index.html'] if routes is set. An array of strings writes to each file. For example:
    • With the default configuration, matching foo/bar writes to both <output.path>/foo/bar.html and <output.path>/foo/bar/index.html
    • In the case of the base route (ie /), this value will make assumptions to produce sane values. For example:
      • [route].html or [route]/index.html writes to <output.path>/index.html
      • subdirectory/[route]/index.html writes to <output.path>/subdirectory/index.html

Readme

Keywords

none

Package Sidebar

Install

npm i react-router-html-webpack-plugin

Weekly Downloads

2

Version

0.2.1

License

none

Last publish

Collaborators

  • saiichihashimoto