<commit_before>import { task, parallel, series } from 'gulp'
import loadPlugins from 'gulp-load-plugins'
import rimraf from 'rimraf'
import webpack from 'webpack'

import config from '../../config'

const g = loadPlugins()
const { log, PluginError } = g.util

// ----------------------------------------
// Clean
// ----------------------------------------

task('clean:umd', (cb) => {
  rimraf(config.paths.umdDist(), cb)
})

// ----------------------------------------
// Build
// ----------------------------------------

task('build:umd:webpack', (cb) => {
  const webpackUMDConfig = require('../../webpack.umd.config')
  const compiler = webpack(webpackUMDConfig)

  compiler.run((err, stats) => {
    const { errors, warnings } = stats.toJson()

    log(stats.toString(config.compiler_stats))

    if (err) {
      log('Webpack compiler encountered a fatal error.')
      throw new PluginError('webpack', err.toString())
    }
    if (errors.length > 0) {
      log('Webpack compiler encountered errors.')
      throw new PluginError('webpack', errors.toString())
    }
    if (warnings.length > 0 && config.compiler_fail_on_warning) {
      throw new PluginError('webpack', warnings.toString())
    }

    cb(err)
  })
})

task('build:umd', series(
  parallel(
    'dll',
    'clean:umd',
  ),<commit_msg>chore(umd): fix gulp task require default<commit_after>import { task, parallel, series } from 'gulp'
import loadPlugins from 'gulp-load-plugins'
import rimraf from 'rimraf'
import webpack from 'webpack'

import config from '../../config'

const g = loadPlugins()
const { log, PluginError } = g.util

// ----------------------------------------
// Clean
// ----------------------------------------

task('clean:umd', (cb) => {
  rimraf(config.paths.umdDist(), cb)
})

// ----------------------------------------
// Build
// ----------------------------------------

task('build:umd:webpack', (cb) => {
  const webpackUMDConfig = require('../../webpack.umd.config').default
  const compiler = webpack(webpackUMDConfig)

  compiler.run((err, stats) => {
    const { errors, warnings } = stats.toJson()

    log(stats.toString(config.compiler_stats))

    if (err) {
      log('Webpack compiler encountered a fatal error.')
      throw new PluginError('webpack', err.toString())
    }
    if (errors.length > 0) {
      log('Webpack compiler encountered errors.')
      throw new PluginError('webpack', errors.toString())
    }
    if (warnings.length > 0 && config.compiler_fail_on_warning) {
      throw new PluginError('webpack', warnings.toString())
    }

    cb(err)
  })
})

task('build:umd', series(
  parallel(
    'dll',
    'clean:umd',
  ),
{'fraction_non_alphanumeric': 0.262406015037594, 'fraction_numerical': 0.0015037593984962407, 'mean_word_length': 2.0834298957126305, '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': '1500095', 'n_tokens_mistral': 783, 'n_tokens_neox': 762, 'n_words': 179}