<commit_before>'use strict';

const WebpackDevServer = require('webpack-dev-server');
const webpack = require('webpack');

const metalsmith = require('./metalsmith');
const Logger = require('./logger');
const watch = require('./watch');
const webpackConfig = require('../webpack.config');

function serv() {

  return new Promise(resolve => {

    const compiler = webpack(webpackConfig);
    const server = new WebpackDevServer(compiler, {
      contentBase: './build',
      noInfo: false, // display no info to console (only warnings and errors)
      quiet: false, // display nothing to the console
      colors: true,
      stats: { colors: true },
      watchOptions: {
        aggregateTimeout: 1200,
        poll: 1000
      }
    });

    server.listen(3000, () => {
      Logger.ok('webpack server');
      resolve();
    });

  });

}

function start() {

  return metalsmith()
    .then(serv)
    .then(watch)
    .catch( (err) => {
      Logger.error(err);
    });
}

module.exports = start;
<commit_msg>add logging to npm start<commit_after>'use strict';

const WebpackDevServer = require('webpack-dev-server');
const webpack = require('webpack');

const metalsmith = require('./metalsmith');
const Logger = require('./logger');
const watch = require('./watch');
const webpackConfig = require('../webpack.config');

function serv() {

  Logger.info('Starting webpack development server');

  return new Promise(resolve => {

    const compiler = webpack(webpackConfig);
    const server = new WebpackDevServer(compiler, {
      contentBase: './build',
      noInfo: false, // display no info to console (only warnings and errors)
      quiet: false, // display nothing to the console
      colors: true,
      stats: { colors: true },
      watchOptions: {
        aggregateTimeout: 1200,
        poll: 1000
      }
    });

    server.listen(3000, () => {
      Logger.ok('Finished webpack development server');
      resolve();
    });

  });

}

function start() {

  return metalsmith()
    .then(serv)
    .then(watch)
    .catch( (err) => {
      Logger.error(err);
    });
}

module.exports = start;

{'fraction_non_alphanumeric': 0.14804337576614804, 'fraction_numerical': 0.011315417256011316, 'mean_word_length': 2.9369202226345084, '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': '1295641', 'n_tokens_mistral': 638, 'n_tokens_neox': 594, 'n_words': 164}