<commit_before>/**
 * buildsys/task/webpack
 * @author <NAME>
 * ------------------------------------
 * TASK: Webpack
 * 'gulp webpack'
*/

const webpack = require('webpack')
const gutil = require('gulp-util')
const webpackDevServer = require('webpack-dev-server')
const webpackConfig = require('../../webpack.config.js')

/* $ gulp webpack */
gulp.task('webpack', (cb) => {
  // run webpack
  webpack(webpackConfig, function (err, stats) {
    if (err) throw new gutil.PluginError('webpack', err)
    gutil.log('[webpack]', stats.toString({
      // output options
    }))
    cb()
  })
})

/* $ gulp webpack-dev-server */
gulp.task('webpack-dev-server', (cb) => {

  // Start a webpack-dev-server
  var compiler = webpack(webpackConfig)

  new webpackDevServer(compiler, {
    contentBase: './public',
    inline: true,
    hot: true,
    stats: {
      colors: true
    },
  }).listen(8000, 'localhost', function (err) {
    if (err) throw new gutil.PluginError('webpack-dev-server', err)
    // Server listening<commit_msg>added colors to webpack builds<commit_after>/**
 * buildsys/task/webpack
 * @author <NAME>
 * ------------------------------------
 * TASK: Webpack
 * 'gulp webpack'
*/

const webpack = require('webpack')
const gutil = require('gulp-util')
const webpackDevServer = require('webpack-dev-server')
const webpackConfig = require('../../webpack.config.js')

/* $ gulp webpack */
gulp.task('webpack', (cb) => {
  // run webpack
  webpack(webpackConfig, function (err, stats) {
    if (err) throw new gutil.PluginError('webpack', err)
    gutil.log('[webpack]', stats.toString({
      colors: true
    }))
    cb()
  })
})

/* $ gulp webpack-dev-server */
gulp.task('webpack-dev-server', (cb) => {

  // Start a webpack-dev-server
  var compiler = webpack(webpackConfig)

  new webpackDevServer(compiler, {
    contentBase: './public',
    inline: true,
    hot: true,
    stats: {
      colors: true
    },
  }).listen(8000, 'localhost', function (err) {
    if (err) throw new gutil.PluginError('webpack-dev-server', err)
    // Server listening
{'fraction_non_alphanumeric': 0.1997098646034816, 'fraction_numerical': 0.0038684719535783366, 'mean_word_length': 2.860074626865672, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3480770', 'n_tokens_mistral': 672, 'n_tokens_neox': 657, 'n_words': 151}