<commit_before>'use strict'

const path    = require('path')
const babel   = require('rollup-plugin-babel')
const resolve = require('rollup-plugin-node-resolve')
const banner  = require('./banner.js')

const BUNDLE  = process.env.BUNDLE === 'true'

let fileDest  = 'boosted.js'
const external = ['jquery', 'tablesorter', 'swiper', 'popper.js', 'focus-visible']
const plugins = [
  babel({
    exclude: 'node_modules/**', // Only transpile our source code
    externalHelpersWhitelist: [ // Include only required helpers
      'defineProperties',
      'createClass',
      'inheritsLoose',
      'defineProperty',
      'objectSpread2'
    ]
  })
]
const globals = {
  jquery: 'jQuery', // Ensure we use jQuery which is always available even in noConflict mode
  tablesorter: 'tablesorter',
  swiper: 'Swiper',
  'popper.js': 'Popper',
  'focus-visible': 'focus-visible'
}

if (BUNDLE) {
  fileDest = 'boosted.bundle.js'
  // Remove last entry in external array to bundle focus-visible
  external.pop()
  delete globals['focus-visible']
  plugins.push(resolve())
  // Remove last entry in external array to bundle Popper
  external.pop()
  delete globals['popper.js']
  plugins.push(resolve())
  // Remove last entry in external array to bundle Swiper
  external.pop()
  delete globals.swiper
  plugins.push(resolve())
  // Remove last entry in external array to bundle tablesort
  external.pop()
  delete globals.tablesorter
  plugins.push(resolve())
}

module.exports = {
  input: path.resolve(__dirname, '../js/src/index.js'),
  output: {
    banner,
    file: path.resolve(__dirname, `../dist/js/${fileDest}`),
    format: 'umd',
    globals,
    name: 'boosted'
  },
  external,
  plugins
}<commit_msg>chore(rollup): clean up config since tree shaking drops tableSorter & Swiper anymway…<commit_after>'use strict'

const path    = require('path')
const babel   = require('rollup-plugin-babel')
const resolve = require('rollup-plugin-node-resolve')
const banner  = require('./banner.js')

const BUNDLE  = process.env.BUNDLE === 'true'

let fileDest  = 'boosted.js'
const external = ['jquery', 'popper.js']
const plugins = [
  babel({
    exclude: 'node_modules/**', // Only transpile our source code
    externalHelpersWhitelist: [ // Include only required helpers
      'defineProperties',
      'createClass',
      'inheritsLoose',
      'defineProperty',
      'objectSpread2'
    ]
  })
]
const globals = {
  jquery: 'jQuery', // Ensure we use jQuery which is always available even in noConflict mode
  'popper.js': 'Popper'
}

if (BUNDLE) {
  fileDest = 'boosted.bundle.js'
  // Remove last entry in external array to bundle Popper
  external.pop()
  delete globals['popper.js']
  plugins.push(resolve())
}

module.exports = {
  input: path.resolve(__dirname, '../js/src/index.js'),
  output: {
    banner,
    file: path.resolve(__dirname, `../dist/js/${fileDest}`),
    format: 'umd',
    globals,
    name: 'boosted'
  },
  external,
  plugins
}
{'fraction_non_alphanumeric': 0.1423258958755916, 'fraction_numerical': 0.000676132521974307, 'mean_word_length': 3.566358024691358, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '773498', 'n_tokens_mistral': 955, 'n_tokens_neox': 954, 'n_words': 250}