<commit_before>const opn = require('opn'),
    webpack = require('webpack'),
    express = require('express'),

    config = require('../config.js'),
    webpackConfig = require('./webpack.config.dev.js'),

    uri = 'http://localhost:' + config.dev.port,
    app = express(),
    compiler = webpack(webpackConfig),

    devMiddleware = require('webpack-dev-middleware')(compiler, {
        publicPath: webpackConfig.output.publicPath,
        logLevel: 'error'
    }),
    hotMiddleware = require('webpack-hot-middleware')(compiler, {
        log: console.log
    });

compiler.plugin('compilation', compilation => {
    compilation.plugin('html-webpack-plugin-after-emit', () => {
        hotMiddleware.publish({action: 'reload'});
    });
});

app.use(devMiddleware);
app.use(hotMiddleware);

app.use(config.dev.assetsVirtualRoot, express.static('./static'));

devMiddleware.waitUntilValid(() => {
    console.log('> Listening at ' + uri + '\n');
});

module.exports = app.listen(config.dev.port, err => {

    if (err) {
        return console.log(err);
    }

    opn(uri);

});<commit_msg>update build<commit_after>const opn = require('opn'),
    webpack = require('webpack'),
    express = require('express'),

    config = require('../config.js'),
    webpackConfig = require('./webpack.config.dev.js'),

    uri = 'http://localhost:' + config.dev.port,
    compiler = webpack(webpackConfig),

    devMiddleware = require('webpack-dev-middleware')(compiler, {
        publicPath: webpackConfig.output.publicPath,
        logLevel: 'error'
    }),
    hotMiddleware = require('webpack-hot-middleware')(compiler, {
        log: console.log
    }),
    app = express();

compiler.plugin('compilation', compilation => {
    compilation.plugin('html-webpack-plugin-after-emit', () => {
        hotMiddleware.publish({action: 'reload'});
    });
});

app
.use(devMiddleware)
.use(hotMiddleware)
.use(config.dev.assetsVirtualRoot, express.static('./static'));

devMiddleware.waitUntilValid(() => {
    console.log('> Listening at ' + uri + '\n');
});

module.exports = app.listen(config.dev.port, err => {

    if (err) {
        return console.log(err);
    }

    opn(uri);

});
{'fraction_non_alphanumeric': 0.18340210912425492, 'fraction_numerical': 0.0, 'mean_word_length': 3.417004048582996, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '319607', 'n_tokens_mistral': 666, 'n_tokens_neox': 665, 'n_words': 104}