<commit_before>// JavaScript Document

// Scripts written by __gulp_init__author_name @ __gulp_init__author_company

module.exports = {
    scripts(gulp, plugins, ran_tasks, on_error) {
        // task-specific plugins
        const eslint  = require("gulp-eslint");
        const webpack = require("webpack-stream");

        // lint custom scripts
        const lint_scripts = (js_directory, file_name = "modern.js", source = [global.settings.paths.src + "/assets/scripts/**/*.js", "!" + global.settings.paths.src + "/assets/scripts/vendor/**/*"], extra =  [global.settings.paths.src + "/assets/scripts/**/*.js"]) => {
            return gulp.src(source)
                // prevent breaking on error
                .pipe(plugins.plumber({errorHandler: on_error}))
                // check if source is newer than destination
                .pipe(plugins.gulpif(!plugins.argv.dist, plugins.newer(js_directory + "/" + file_name, extra)))
                // lint all non-vendor scripts
                .pipe(eslint())
                // print lint errors
                .pipe(eslint.format());
        };

        // process scripts
        const process_scripts = (js_directory, file_name = "modern.js", source = [global.settings.paths.src + "/assets/scripts/*.js"], extra =  [global.settings.paths.src + "/assets/scripts/**/*.js"]) => {
            return new Promise((resolve, reject) => {
                const WEBPACK_CONFIG = require("../webpack.config.js");

                // update webpack config for the current target destination and file name
                WEBPACK_CONFIG.mode   = plugins.argv.dist ? "production" : WEBPACK_CONFIG.mode;
                WEBPACK_CONFIG.output = {filename: file_name};

                const TASK = gulp.src(source)
                    // prevent breaking on error
                    .pipe(plugins.plumber({errorHandler: on_error}))
                    // check if source is newer than destination
                    .pipe(plugins.gulpif(!plugins.argv.dist, plugins.newer(js_directory + "/" + file_name, extra)))
                    // run webpack
                    .pipe(webpack({
                        config: WEBPACK_CONFIG,
                    }))
                    // output to compiled directory
                    .pipe(gulp.dest(js_directory))<commit_msg>Fix how webpack.config.js gets passed to webpack-stream<commit_after>// JavaScript Document

// Scripts written by __gulp_init__author_name @ __gulp_init__author_company

module.exports = {
    scripts(gulp, plugins, ran_tasks, on_error) {
        // task-specific plugins
        const eslint         = require("gulp-eslint");
        const webpack        = require("webpack-stream");
        const webpack_config = require("../webpack.config.js");

        // lint custom scripts
        const lint_scripts = (js_directory, file_name = "modern.js", source = [global.settings.paths.src + "/assets/scripts/**/*.js", "!" + global.settings.paths.src + "/assets/scripts/vendor/**/*"], extra =  [global.settings.paths.src + "/assets/scripts/**/*.js"]) => {
            return gulp.src(source)
                // prevent breaking on error
                .pipe(plugins.plumber({errorHandler: on_error}))
                // check if source is newer than destination
                .pipe(plugins.gulpif(!plugins.argv.dist, plugins.newer(js_directory + "/" + file_name, extra)))
                // lint all non-vendor scripts
                .pipe(eslint())
                // print lint errors
                .pipe(eslint.format());
        };

        // process scripts
        const process_scripts = (js_directory, file_name = "modern.js", source = [global.settings.paths.src + "/assets/scripts/*.js"], extra =  [global.settings.paths.src + "/assets/scripts/**/*.js"]) => {
            return new Promise((resolve, reject) => {
                // update webpack config for the current target destination and file name
                webpack_config.mode   = plugins.argv.dist ? "production" : webpack_config.mode;
                webpack_config.output = {filename: file_name};

                const TASK = gulp.src(source)
                    // prevent breaking on error
                    .pipe(plugins.plumber({errorHandler: on_error}))
                    // check if source is newer than destination
                    .pipe(plugins.gulpif(!plugins.argv.dist, plugins.newer(js_directory + "/" + file_name, extra)))
                    // run webpack
                    .pipe(webpack(webpack_config))
                    // output to compiled directory
                    .pipe(gulp.dest(js_directory))
{'fraction_non_alphanumeric': 0.1263498920086393, 'fraction_numerical': 0.0, 'mean_word_length': 1.919924337957125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2446647', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1184, 'n_words': 269}