<commit_before>import "@babel/polyfill";

import React from "react";
import { StaticRouter } from "react-router";
import { renderToString } from "react-dom/server";
import { extractCritical } from "emotion-server";
import { HelmetProvider } from "react-helmet-async";
import { flushChunkNames } from "react-universal-component/server";
import flushChunks from "webpack-flush-chunks";
import { html } from "common-tags";
import { minify } from "html-minifier";

export default async ({ assets, filename, path, publicPath, stats }) => {
  const App = require("./components/App").default;
  const helmetContext = {};

  const { css, html: app, ids } = extractCritical(
    renderToString(
      <StaticRouter location={path} context={{}}>
        <HelmetProvider context={helmetContext}>
          <App />
        </HelmetProvider>
      </StaticRouter>
    )
  );

  const { helmet } = helmetContext;

  const { scripts } = flushChunks(stats, {
    before: ["runtime", "vendor"],
    after: ["client"],
    chunkNames: flushChunkNames()
  });

  return minify(
    html`
      <!DOCTYPE html>
      <html lang="en" ${helmet.htmlAttributes.toString()}>
        <head>
          <meta name="version" content="${stats.hash}" />
          <meta charset="utf-8" />
          ${helmet.title.toString()}
          <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
          <meta
            name="viewport"
            content="width=device-width, initial-scale=1.0"
          />
          ${helmet.meta.toString()}
          <link rel="icon" href="/favicon.ico" type="image/x-icon" />
          <link rel="apple-touch-icon" sizes="192x192" href="/icon-192.png" />
          <link rel="apple-touch-icon" sizes="512x512" href="/icon-512.png" />
          ${helmet.link.toString()}
          <link rel="preconnect" href="https://fonts.gstatic.com" />
          <style>
            ${css}
          </style>
          ${
            scripts.map(
              src =>
                `<script type="text/javascript" src="/${src}" rel="subresource" defer></script>`
            )
          }
          <script id="emotion-ids">
            ${JSON.stringify(ids)};
          </script>
        </head>
        <body ${helmet.bodyAttributes.toString()}>
          <div id="root">${app}</div>
        </body>
      </html>
    `,
    {
      collapseWhitespace: true,
      preserveLineBreaks: true
    }
  );
};<commit_msg>fix: Disable prettier because things<commit_after>import "@babel/polyfill";

import React from "react";
import { StaticRouter } from "react-router";
import { renderToString } from "react-dom/server";
import { extractCritical } from "emotion-server";
import { HelmetProvider } from "react-helmet-async";
import { flushChunkNames } from "react-universal-component/server";
import flushChunks from "webpack-flush-chunks";
import { html } from "common-tags";
import { minify } from "html-minifier";

export default async ({ assets, filename, path, publicPath, stats }) => {
  const App = require("./components/App").default;
  const helmetContext = {};

  const { css, html: app, ids } = extractCritical(
    renderToString(
      <StaticRouter location={path} context={{}}>
        <HelmetProvider context={helmetContext}>
          <App />
        </HelmetProvider>
      </StaticRouter>
    )
  );

  const { helmet } = helmetContext;

  const { scripts } = flushChunks(stats, {
    before: ["runtime", "vendor"],
    after: ["client"],
    chunkNames: flushChunkNames()
  });

  /* eslint-disable */
  return minify(html`
      <!DOCTYPE html>
      <html lang="en" ${helmet.htmlAttributes.toString()}>
        <head>
          <meta name="version" content="${stats.hash}" />
          <meta charset="utf-8" />
          ${helmet.title.toString()}
          <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
          <meta name="viewport" content="width=device-width, initial-scale=1.0" />
          ${helmet.meta.toString()}
          <link rel="icon" href="/favicon.ico" type="image/x-icon" />
          <link rel="apple-touch-icon" sizes="192x192" href="/icon-192.png" />
          <link rel="apple-touch-icon" sizes="512x512" href="/icon-512.png" />
          ${helmet.link.toString()}
          <link rel="preconnect" href="https://fonts.gstatic.com" />
          <style>
            ${css}
          </style>
          ${scripts.map(src =>
            `<script type="text/javascript" src="/${src}" rel="subresource" defer></script>`
          )}
          <script id="emotion-ids">${JSON.stringify(ids)}</script>
        </head>
        <body ${helmet.bodyAttributes.toString()}>
          <div id="root">${app}</div>
        </body>
      </html>
    `, { collapseWhitespace: true, preserveLineBreaks: true }
  );
};
{'fraction_non_alphanumeric': 0.16852984602404555, 'fraction_numerical': 0.008858890529424172, 'mean_word_length': 2.5680963130173065, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 63, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4353526', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1400, 'n_words': 287}