<commit_before>// JavaScript Document

// Scripts written by __gulp_init_author_name__ @ __gulp_init_author_company__

const GLOB = require("glob");

module.exports = {
    config(plugins, source_directory, js_directory) {
        return {
            mode:   plugins.argv.dist ? "production" : "development",
            entry:  {
                "critical":       GLOB.sync(source_directory + "/critical/**/*.js"),
                "legacy":         GLOB.sync(source_directory + "/legacy/**/*.js"),
                "modern":         GLOB.sync(source_directory + "/modern/**/*.js"),
                "service-worker": GLOB.sync(source_directory + "/service-worker/**/*.js"),
            },
            output: {
                path:     plugins.path.resolve(__dirname, js_directory),
                filename: "[name].js",
            },
        };
    }
};<commit_msg>Automatically buildu webpack entry points; Close #168<commit_after>// JavaScript Document

// Scripts written by __gulp_init_author_name__ @ __gulp_init_author_company__

const GLOB = require("glob");

module.exports = {
    config(plugins, source_directory, js_directory) {
        const ENTRY = {};

        const SCRIPT_FOLDERS = plugins.fs.readdirSync(source_directory);

        // automatically build entry points based on folders in src/assets/scripts
        if (SCRIPT_FOLDERS.length > 0) {
            SCRIPT_FOLDERS.forEach((folder) => {
                ENTRY[folder] = GLOB.sync(source_directory + "/" + folder + "/**/*.js");
            });
        }

        return {
            mode:   plugins.argv.dist ? "production" : "development",
            entry:  ENTRY,
            output: {
                path:     plugins.path.resolve(__dirname, js_directory),
                filename: "[name].js",
            },
        };
    }
};
{'fraction_non_alphanumeric': 0.1327092511013216, 'fraction_numerical': 0.0022026431718061676, 'mean_word_length': 1.9934102141680394, 'pattern_counts': {'":': 4, '<': 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': '5241619', 'n_tokens_mistral': 529, 'n_tokens_neox': 501, 'n_words': 95}