<commit_before>const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const AngularGetTextPlugin = require('./angular-gettext-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const utils = require('./webpack.utils');

const scssPath = path.resolve('./assets/sass');
const imagesPath = path.resolve('./assets/images');

module.exports = {
  entry: {
    index: './app/scripts/index.js',
  },
  output: {
    path: utils.formatPath('.'),
    publicPath: '',
    filename: 'scripts/[name].bundle.js?[hash]',
    chunkFilename: 'scripts/[name].js?[chunkhash]',
  },
  resolve: {
    extensions: ['.js', '.jsx', '.ts', '.tsx'],
    alias: {
      '@waldur': path.resolve('./app/scripts/components/'),
    }
  },
  devtool: 'source-map',
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        use: [
          {
            loader: 'babel-loader',
          },
        ],
      },
      {
        test: /\.tsx?$/,
        loader: 'awesome-typescript-loader'
      },
      // Temporary workaround for Angular UI router and React Bootstrap integration
      {
        test: /SafeAnchor\.js$/,
        loader: 'awesome-typescript-loader'
      },
      {
        test: /\.html$/,
        use: [
          {
            loader: 'html-loader',
            options: {
              minimize: true,
            },
          },
        ],
      },
      {
        test: /\.scss$/,
        loader: ExtractTextPlugin.extract({
          fallback: 'style-loader',
          use: [
            utils.isProd ? 'css-loader': 'css-loader?sourceMap',
            utils.isProd ? 'postcss-loader': 'postcss-loader?sourceMap',
            utils.isProd ? 'sass-loader?includePaths[]=' + scssPath : 'sass-loader?sourceMap&includePaths[]=' + scssPath,
          ]
        }),
      },
      {
        test: /\.css$/,
        loader: ExtractTextPlugin.extract({
          fallback: 'style-loader',
          use: utils.isProd ? 'css-loader' : 'css-loader?sourcemap',
        })
      },
      {
        test: /\.(eot|svg|otf|ttf|woff|woff2)(\?v=\d+\.\d+\.\d+)?/,
        use: [
          {
            loader: 'file-loader',
            options: {
              publicPath: '../',
              name: 'fonts/[name].[ext]?[hash]'
            }
          },
        ],
      },
      {
        test: /\.(png|jpg|jpeg|gif|ico)$/,
        use: [
          {
            loader: 'file-loader',
            options: {
              publicPath: '../',
              name: 'images/[name].[ext]?[hash]'
            },
          },
        ],
      }
    ],
  },
  plugins: [
    // Temporary workaround for Angular UI router and React Bootstrap integration
    new webpack.NormalModuleReplacementPlugin(
      /SafeAnchor.js/,
      path.resolve('./app/scripts/shims/AngularRouterAnchor.tsx'),
    ),
    new HtmlWebpackPlugin({
      template: './app/index-template.html',
      filename: utils.formatPath('index.html'),
      inject: 'body',
      chunks: ['index'],
      alwaysWriteToDisk: true,
      chunksSortMode: function(a, b) {
        return (a.names[0] < b.names[0]) ? 1 : -1;
      }
    }),<commit_msg>Remove dangling comma to make linter happy.<commit_after>const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const AngularGetTextPlugin = require('./angular-gettext-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const utils = require('./webpack.utils');

const scssPath = path.resolve('./assets/sass');
const imagesPath = path.resolve('./assets/images');

module.exports = {
  entry: {
    index: './app/scripts/index.js',
  },
  output: {
    path: utils.formatPath('.'),
    publicPath: '',
    filename: 'scripts/[name].bundle.js?[hash]',
    chunkFilename: 'scripts/[name].js?[chunkhash]',
  },
  resolve: {
    extensions: ['.js', '.jsx', '.ts', '.tsx'],
    alias: {
      '@waldur': path.resolve('./app/scripts/components/'),
    }
  },
  devtool: 'source-map',
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        use: [
          {
            loader: 'babel-loader',
          },
        ],
      },
      {
        test: /\.tsx?$/,
        loader: 'awesome-typescript-loader'
      },
      // Temporary workaround for Angular UI router and React Bootstrap integration
      {
        test: /SafeAnchor\.js$/,
        loader: 'awesome-typescript-loader'
      },
      {
        test: /\.html$/,
        use: [
          {
            loader: 'html-loader',
            options: {
              minimize: true,
            },
          },
        ],
      },
      {
        test: /\.scss$/,
        loader: ExtractTextPlugin.extract({
          fallback: 'style-loader',
          use: [
            utils.isProd ? 'css-loader': 'css-loader?sourceMap',
            utils.isProd ? 'postcss-loader': 'postcss-loader?sourceMap',
            utils.isProd ? 'sass-loader?includePaths[]=' + scssPath : 'sass-loader?sourceMap&includePaths[]=' + scssPath,
          ]
        }),
      },
      {
        test: /\.css$/,
        loader: ExtractTextPlugin.extract({
          fallback: 'style-loader',
          use: utils.isProd ? 'css-loader' : 'css-loader?sourcemap',
        })
      },
      {
        test: /\.(eot|svg|otf|ttf|woff|woff2)(\?v=\d+\.\d+\.\d+)?/,
        use: [
          {
            loader: 'file-loader',
            options: {
              publicPath: '../',
              name: 'fonts/[name].[ext]?[hash]'
            }
          },
        ],
      },
      {
        test: /\.(png|jpg|jpeg|gif|ico)$/,
        use: [
          {
            loader: 'file-loader',
            options: {
              publicPath: '../',
              name: 'images/[name].[ext]?[hash]'
            },
          },
        ],
      }
    ],
  },
  plugins: [
    // Temporary workaround for Angular UI router and React Bootstrap integration
    new webpack.NormalModuleReplacementPlugin(
      /SafeAnchor.js/,
      path.resolve('./app/scripts/shims/AngularRouterAnchor.tsx')
    ),
    new HtmlWebpackPlugin({
      template: './app/index-template.html',
      filename: utils.formatPath('index.html'),
      inject: 'body',
      chunks: ['index'],
      alwaysWriteToDisk: true,
      chunksSortMode: function(a, b) {
        return (a.names[0] < b.names[0]) ? 1 : -1;
      }
    }),
{'fraction_non_alphanumeric': 0.17312072892938496, 'fraction_numerical': 0.0015186028853454822, 'mean_word_length': 1.7579564489112227, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3274954', 'n_tokens_mistral': 2063, 'n_tokens_neox': 2014, 'n_words': 338}