/**
 * This is used by the HtmlWebpackPlugin to generate an html page that we will
 * use as a fallback for our service worker when the user is offline.  It will
 * embed all the required asset paths needed to bootstrap the application
 * in an offline session.
 */

import React from 'react';
import Helmet from 'react-helmet';
import { renderToStaticMarkup } from 'react-dom/server';
import HTML from 'components/html';

module.exports = function generate(context) {
  const { config, ClientConfig } = context.htmlWebpackPlugin.options.custom;

  const html = renderToStaticMarkup(
    <HTML
      helmet={<Helmet {...config('helmet')} /> && Helmet.rewind()}
      bodyElements={<ClientConfig nonce="OFFLINE_PAGE_NONCE_PLACEHOLDER" />}
    />,
  );

  return `<!DOCTYPE html>${html}`;
};

@@ -416,16 +416,87 @@
 html';%0A%0A
+// No server available for SW, so no hash%0Aconst addHash = str =%3E str;%0A%0A
 module.e
@@ -797,16 +797,34 @@
 EHOLDER%22
+ addHash=%7BaddHash%7D
  /%3E%7D%0A   

Fix addHash missing #97