React/pre-render

npm install --save-dev prerender-spa-plugin
    
webpack.config.js
const PrerenderSPAPlugin = require("prerender-spa-plugin");

module.exports = (config, env) => {
  if (env === "production") {
    config.plugins = config.plugins.concat([
      new PrerenderSPAPlugin({
        routes: ["/", "/about"], // 事前にレンダリングしておきたいページ
        staticDir: path.join(__dirname, "build")
      })
    ]);
  }

  return config;
};