<commit_before>const fs = require('fs-extra');
const _ = require('lodash');

// -----------------------------------------------------------------------------
// Loads webpack assets file
// -----------------------------------------------------------------------------
function loadWebpackAssets(app, packResults) {
  let webpackAssets = null;
  const webpackAssetsFilePath = `${packResults.webpackConfig.output.path}/${app.name}-webpack-assets.json`;
  if (fs.existsSync(webpackAssetsFilePath)) {
    webpackAssets = fs.readJsonSync(webpackAssetsFilePath);
  }
  return webpackAssets;
}

// -----------------------------------------------------------------------------
// Changes webpack paths as needed.
// -----------------------------------------------------------------------------
function apply(html, webpackAssets, buildSuffix) {
  let result = html;
  if (!webpackAssets) {
    throw new Error('Invalid webpack assets.');
  }
  _.each(webpackAssets, (assets, name) => {<commit_msg>t stash pop Merge remote-tracking branch 'upstream/master'<commit_after>const fs = require('fs-extra');
const _ = require('lodash');

// -----------------------------------------------------------------------------
// Loads webpack assets file
// -----------------------------------------------------------------------------
function loadWebpackAssets(app) {
  let webpackAssets = null;
  const webpackAssetsFilePath = `${app.outputPath}/${app.name}-webpack-assets.json`;
  if (fs.existsSync(webpackAssetsFilePath)) {
    webpackAssets = fs.readJsonSync(webpackAssetsFilePath);
  }
  return webpackAssets;
}

// -----------------------------------------------------------------------------
// Changes webpack paths as needed.
// -----------------------------------------------------------------------------
function apply(html, webpackAssets, buildSuffix) {
  let result = html;
  if (!webpackAssets) {
    throw new Error('Invalid webpack assets.');
  }
  _.each(webpackAssets, (assets, name) => {
{'fraction_non_alphanumeric': 0.4051333668847509, 'fraction_numerical': 0.0, 'mean_word_length': 1.2798165137614679, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '2471647', 'n_tokens_mistral': 453, 'n_tokens_neox': 451, 'n_words': 97}