<commit_before>const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')

const {
  BaseHrefWebpackPlugin,
  GlobCopyWebpackPlugin
} = require('@angular/cli/plugins/webpack')

const { root } = require('./tools/webpack-helpers')

const {
  HashedModuleIdsPlugin,
  ContextReplacementPlugin,
  ProgressPlugin,
  optimize
} = webpack
const { CommonsChunkPlugin } = optimize

module.exports = {
  entry: {
    app: './src/app/main.ts',
    polyfills: './src/app/polyfills.ts'
  },

  output: {
    path: root('dist', 'app'),
    // publicPath: '/',
    filename: '[name].js',
    chunkFilename: '[id].chunk.js'
  },

  target: 'electron-renderer',

  resolve: {
    extensions: ['.ts', '.js', '.json'],
    modules: ['./node_modules']
  },

  resolveLoader: {
    modules: ['./node_modules']
  },

  externals: {
    keytar: 'require(\'keytar\')'
  },

  devtool: 'inline-source-map',

  watchOptions: {
    aggregateTimeout: 1000,
    ignored: ['node_modules', 'dist']
  },

  module: {
    rules: [
      {
        test: /\.ts$/,
        loaders: [
          {
            loader: 'awesome-typescript-loader',
            options: { configFileName: './tsconfig.json' }
          },
          'angular2-template-loader'
        ]
      },
      {
        test: /\.html$/,
        loader: 'html-loader'
      },
      {
        test: /\.(png|jpe?g|gif|svg|woff2?|(t|o)tf|eot|ico)$/,
        loader: [
          {
            loader: 'file-loader',
            options: { name: 'assets/[name].[hash].[ext]' }
          }
        ]
      },
      {
        test: /\.css$/,
        include: root('src', 'app', 'style'),
        loader: ExtractTextPlugin.extract({
          use: [
            {
              loader: 'css-loader',
              options: { sourceMap: true, importLoaders: 1 }
            },
            {
              loader: 'postcss-loader',
              options: { sourceMap: 'inline' }
            }
          ],
          fallback: 'style-loader'
        })
      },
      {
        test: /\.css$/,
        exclude: root('src', 'app', 'style'),
        loaders: [
          'to-string-loader',
          {
            loader: 'css-loader',
            options: { sourceMap: true, importLoaders: 1 }
          },
          {
            loader: 'postcss-loader',
            options: { sourceMap: 'inline' }
          }
        ]
      }
    ]
  },

  plugins: [
    new ProgressPlugin(),

    new GlobCopyWebpackPlugin({
      patterns: ['assets', 'icons', 'monux.*'],
      globOptions: {
        cwd: root('./src'),
        dot: true,
        ignore: '**/.gitkeep'
      }
    }),

    new ContextReplacementPlugin(
      /angular(\\|\/)core(\\|\/)@angular/,
      './src/app',
      {}
    ),

    new HtmlWebpackPlugin({
      template: './src/app/index.html'
    }),

    new BaseHrefWebpackPlugin({}),

    new CommonsChunkPlugin({
      name: ['app', 'polyfills']
    }),

    new ExtractTextPlugin('[name].css'),

    new HashedModuleIdsPlugin({
      hashFunction: 'sha256',
      hashDigest: 'base64',
      hashDigestLength: 5
    })
  ]
}
<commit_msg>shorten generated file name hashes<commit_after>const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')

const {
  BaseHrefWebpackPlugin,
  GlobCopyWebpackPlugin
} = require('@angular/cli/plugins/webpack')

const { root } = require('./tools/webpack-helpers')

const {
  HashedModuleIdsPlugin,
  ContextReplacementPlugin,
  ProgressPlugin,
  optimize
} = webpack
const { CommonsChunkPlugin } = optimize

module.exports = {
  entry: {
    app: './src/app/main.ts',
    polyfills: './src/app/polyfills.ts'
  },

  output: {
    path: root('dist', 'app'),
    // publicPath: '/',
    filename: '[name].js',
    chunkFilename: '[id].chunk.js'
  },

  target: 'electron-renderer',

  resolve: {
    extensions: ['.ts', '.js', '.json'],
    modules: ['./node_modules']
  },

  resolveLoader: {
    modules: ['./node_modules']
  },

  externals: {
    keytar: 'require(\'keytar\')'
  },

  devtool: 'inline-source-map',

  watchOptions: {
    aggregateTimeout: 1000,
    ignored: ['node_modules', 'dist']
  },

  module: {
    rules: [
      {
        test: /\.ts$/,
        loaders: [
          {
            loader: 'awesome-typescript-loader',
            options: { configFileName: './tsconfig.json' }
          },
          'angular2-template-loader'
        ]
      },
      {
        test: /\.html$/,
        loader: 'html-loader'
      },
      {
        test: /\.(png|jpe?g|gif|svg|woff2?|(t|o)tf|eot|ico)$/,
        loader: [
          {
            loader: 'file-loader',
            options: { name: 'assets/[name].[hash:8].[ext]' }
          }
        ]
      },
      {
        test: /\.css$/,
        include: root('src', 'app', 'style'),
        loader: ExtractTextPlugin.extract({
          use: [
            {
              loader: 'css-loader',
              options: { sourceMap: true, importLoaders: 1 }
            },
            {
              loader: 'postcss-loader',
              options: { sourceMap: 'inline' }
            }
          ],
          fallback: 'style-loader'
        })
      },
      {
        test: /\.css$/,
        exclude: root('src', 'app', 'style'),
        loaders: [
          'to-string-loader',
          {
            loader: 'css-loader',
            options: { sourceMap: true, importLoaders: 1 }
          },
          {
            loader: 'postcss-loader',
            options: { sourceMap: 'inline' }
          }
        ]
      }
    ]
  },

  plugins: [
    new ProgressPlugin(),

    new GlobCopyWebpackPlugin({
      patterns: ['assets', 'icons', 'monux.*'],
      globOptions: {
        cwd: root('./src'),
        dot: true,
        ignore: '**/.gitkeep'
      }
    }),

    new ContextReplacementPlugin(
      /angular(\\|\/)core(\\|\/)@angular/,
      './src/app',
      {}
    ),

    new HtmlWebpackPlugin({
      template: './src/app/index.html'
    }),

    new BaseHrefWebpackPlugin({}),

    new CommonsChunkPlugin({
      name: ['app', 'polyfills']
    }),

    new ExtractTextPlugin('[name].css'),

    new HashedModuleIdsPlugin({
      hashFunction: 'sha256',
      hashDigest: 'base64',
      hashDigestLength: 8
    })
  ]
}

{'fraction_non_alphanumeric': 0.16914876939959242, 'fraction_numerical': 0.004546167110832419, 'mean_word_length': 1.7727075184702303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '186229', 'n_tokens_mistral': 2079, 'n_tokens_neox': 2008, 'n_words': 344}