<commit_before>const path = require("path");
const webpack = require("webpack");
const CompressionPlugin = require("compression-webpack-plugin");

const config = {
    entry: "./src/index.ts",
    output: {
        filename: "script.js",
        path: path.resolve(__dirname, "dist"),
    },
    devServer: {
        contentBase: "./dist",
    },
    resolve: {
        extensions: [".js", ".ts", ".jsx", ".tsx"],
    },
    module: {
        rules: [
            {
                test: /[.]sass$/,
                exclude: /[/]node_modules[/]/,
                use: [
                    "style-loader",
                    "css-loader",
                    {
                        loader: "sass-loader",
                        options: {
                            implementation: require("sass"),
                        },
                    },
                ],
            },
            {
                test: /[.](js|ts)x?$/,
                exclude: /[/]node_modules[/]/,
                loader: "babel-loader",
            },
            {
                test: /[.]bin$/,
                exclude: /[/]node_modules[/]/,
                loader: "file-loader",
            },
        ],
    },
    plugins: [],
};

module.exports = (env, argv) => {
    switch (argv.mode) {
        case "production":
            config.plugins.push(new CompressionPlugin({
                filename: '[path].br[query]',
                algorithm: 'brotliCompress',
                test: /[.](js|bin)$/,
                cache: true,
            }));
            break;
        default:
            // breaks webpack-dev-server
            // config.plugins.push(new webpack.debug.ProfilingPlugin());
            break;
    }<commit_msg>configure webpack devtool<commit_after>const path = require("path");
const webpack = require("webpack");
const CompressionPlugin = require("compression-webpack-plugin");

const config = {
    entry: "./src/index.ts",
    output: {
        filename: "script.js",
        path: path.resolve(__dirname, "dist"),
    },
    devServer: {
        contentBase: "./dist",
    },
    resolve: {
        extensions: [".js", ".ts", ".jsx", ".tsx"],
    },
    module: {
        rules: [
            {
                test: /[.]sass$/,
                exclude: /[/]node_modules[/]/,
                use: [
                    "style-loader",
                    "css-loader",
                    {
                        loader: "sass-loader",
                        options: {
                            implementation: require("sass"),
                        },
                    },
                ],
            },
            {
                test: /[.](js|ts)x?$/,
                exclude: /[/]node_modules[/]/,
                loader: "babel-loader",
            },
            {
                test: /[.]bin$/,
                exclude: /[/]node_modules[/]/,
                loader: "file-loader",
            },
        ],
    },
    plugins: [],
};

module.exports = (env, argv) => {
    switch (argv.mode) {
        case "production":
            config.devtool = "source-map";
            config.plugins.push(new CompressionPlugin({
                filename: '[path].br[query]',
                algorithm: 'brotliCompress',
                test: /[.](js|bin)$/,
                cache: true,
            }));
            break;
        case "development":
            config.devtool = "cheap-module-eval-source-map";
            break;
        default:
            // breaks webpack-dev-server
            // config.plugins.push(new webpack.debug.ProfilingPlugin());
            break;
    }
{'fraction_non_alphanumeric': 0.15560451666207656, 'fraction_numerical': 0.0, 'mean_word_length': 1.0957876514714369, 'pattern_counts': {'":': 3, '<': 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': '720431', 'n_tokens_mistral': 1007, 'n_tokens_neox': 944, 'n_words': 167}