<commit_before>var gulp = require('gulp');
var webpack = require('webpack');
var paths = require('../paths');
var webpackConfig = require('../../webpack.config.js');

var WebpackDevServer = require("webpack-dev-server");


/**
 * Js task
 * Run using "gulp js"
 * Runs webpack to compile javascript
 */
gulp.task('server', function() {
    webpackConfig.entry.unshift(
        "webpack-dev-server/client?http://localhost:8080",
        "webpack/hot/only-dev-server"
    );
    webpackConfig.plugins = [
        new webpack.HotModuleReplacementPlugin(),
        new webpack.NamedModulesPlugin()
    ];
    var compiler = webpack(webpackConfig);
    server = new WebpackDevServer(compiler, {
        hot: true,
        publicPath: "/static/js/",
        proxy: {
            '/': {
                target: 'http://localhost:8000/',
                secure: false,
                bypass: function(request, response, proxyOptions) {
                    if (request.path.startsWith('/static/js/')) {
                        return request.path;
                    } else if (request.path.indexOf('hot-update') > 0) {
                        // ugly hack, but publicPath is not properly supported :/
                        return '/static/js' + request.path;
                    }
                    return false;
                }
            }
        }
    });
    server.listen(8080);
});
<commit_msg>update docstring<commit_after>var gulp = require('gulp');
var webpack = require('webpack');
var paths = require('../paths');
var webpackConfig = require('../../webpack.config.js');

var WebpackDevServer = require("webpack-dev-server");


/**
 * Server task
 * Run using "gulp server"
 * Starts a webpack dev server on port 8080
 * Proxies request to Django (assumed to be listening on port 8000)
 */
gulp.task('server', function() {
    webpackConfig.entry.unshift(
        "webpack-dev-server/client?http://localhost:8080",
        "webpack/hot/only-dev-server"
    );
    webpackConfig.plugins = [
        new webpack.HotModuleReplacementPlugin(),
        new webpack.NamedModulesPlugin()
    ];
    var compiler = webpack(webpackConfig);
    server = new WebpackDevServer(compiler, {
        hot: true,
        publicPath: "/static/js/",
        proxy: {
            '/': {
                target: 'http://localhost:8000/',
                secure: false,
                bypass: function(request, response, proxyOptions) {
                    if (request.path.startsWith('/static/js/')) {
                        return request.path;
                    } else if (request.path.indexOf('hot-update') > 0) {
                        // ugly hack, but publicPath is not properly supported :/
                        return '/static/js' + request.path;
                    }
                    return false;
                }
            }
        }
    });
    server.listen(8080);
});

{'fraction_non_alphanumeric': 0.13395638629283488, 'fraction_numerical': 0.01176877812391831, 'mean_word_length': 1.7949709864603483, 'pattern_counts': {'":': 0, '<': 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': '1738638', 'n_tokens_mistral': 818, 'n_tokens_neox': 763, 'n_words': 169}