<commit_before>import coffee from 'rollup-plugin-coffee-script'
import includePaths from 'rollup-plugin-includepaths'
import buble from 'rollup-plugin-buble'
import progress from 'rollup-plugin-progress'
import json from 'rollup-plugin-json'
import istanbul from 'rollup-plugin-istanbul'

const includePathOptions = {
  include: {},
  paths: [__dirname + '/modules', __dirname],
  external: [],
  extensions: ['.js', '.coffee']
}

const progressOptions = {
  clearLine: false
}

const libraryConfig = {
  input: 'modules/hexagon.js',
  output: {
    file: 'target/hexagon.js',
    format: 'iife'
  },
  name: 'hx',
  plugins: [
    json(),
    buble({
      exclude: ['**/*.coffee', '**/*.json']
    }),
    coffee({
      exclude: ['**/*.js', '**/*.json']
    }),
    includePaths(includePathOptions),
    progress(progressOptions)
  ]
}

const testConfig = {
  input: 'modules/hexagon.spec.js',
  output: {
    file: 'target/hexagon.test.js',
    format: 'iife'
  },
  name: 'hexagonSpec',
  external: ['chai'],
  globals: {
    'chai': 'window.chai'
  },
  plugins: [
    json(),
    buble({
      exclude: ['**/*.coffee', '**/*.json']
    }),
    coffee({
      exclude: ['**/*.js', '**/*.json']
    }),
    includePaths(includePathOptions),
    progress(progressOptions)
  ]
}

const testCoverageConfig = {
  input: 'modules/hexagon.spec.js',
  output: {
    file: 'target/hexagon.test.coverage.js',
    format: 'iife'
  },
  name: 'hexagonSpec',
  external: ['chai'],
  globals: {
    'chai': 'window.chai'
  },
  plugins: [
    json(),
    buble({
      exclude: ['**/*.coffee']
    }),
    coffee({
      exclude: ['**/*.js']
    }),
    istanbul({
      exclude: ['test/**/*', '**/*spec*'],
      reporters: ['coverage'],
      instrumenterConfig: {
        embedSource: true
      },
      sourceMap: false
    }),
    includePaths(includePathOptions),
    progress(progressOptions)
  ]
}


function resolveHexagon () {
  return {
    resolveId: function (code, id) {
      if (code === 'hexagon-js') {
        return 'modules/hexagon.js'
      }
    }
  }
}

const demoConfig = {
  input: 'demo/index.js',
  output: {
    file: 'target/index.js',
    format: 'iife'
  },
  name: 'hx',
  plugins: [
    json(),
    coffee({
      exclude: ['**/*.js', '**/*.json']
    }),
    buble({
      exclude: ['**/*.coffee', '**/*.json']
    }),
    resolveHexagon(),
    includePaths(includePathOptions),
    progress(progressOptions)
  ]
}

export default [
  libraryConfig,
  testConfig,<commit_msg>Simplify the rollup config<commit_after>import coffee from 'rollup-plugin-coffee-script'
import includePaths from 'rollup-plugin-includepaths'
import buble from 'rollup-plugin-buble'
import progress from 'rollup-plugin-progress'
import json from 'rollup-plugin-json'
import istanbul from 'rollup-plugin-istanbul'

const includePathOptions = {
  include: {},
  paths: [__dirname + '/modules', __dirname],
  external: [],
  extensions: ['.js', '.coffee']
}

const progressOptions = {
  clearLine: false
}

const libraryConfig = {
  input: 'modules/hexagon.js',
  output: {
    file: 'target/hexagon.js',
    format: 'iife'
  },
  name: 'hx',
  plugins: [
    json(),
    coffee(),
    buble(),
    includePaths(includePathOptions),
    progress(progressOptions)
  ]
}

const testConfig = {
  input: 'modules/hexagon.spec.js',
  output: {
    file: 'target/hexagon.test.js',
    format: 'iife'
  },
  name: 'hexagonSpec',
  external: ['chai'],
  globals: {
    'chai': 'window.chai'
  },
  plugins: [
    json(),
    coffee(),
    buble(),
    includePaths(includePathOptions),
    progress(progressOptions)
  ]
}

const testCoverageConfig = {
  input: 'modules/hexagon.spec.js',
  output: {
    file: 'target/hexagon.test.coverage.js',
    format: 'iife'
  },
  name: 'hexagonSpec',
  external: ['chai'],
  globals: {
    'chai': 'window.chai'
  },
  plugins: [
    json(),
    coffee(),
    buble(),
    istanbul({
      exclude: ['test/**/*', '**/*spec*'],
      reporters: ['coverage'],
      instrumenterConfig: {
        embedSource: true
      },
      sourceMap: false
    }),
    includePaths(includePathOptions),
    progress(progressOptions)
  ]
}


function resolveHexagon () {
  return {
    resolveId: function (code, id) {
      if (code === 'hexagon-js') {
        return 'modules/hexagon.js'
      }
    }
  }
}

const demoConfig = {
  input: 'demo/index.js',
  output: {
    file: 'target/index.js',
    format: 'iife'
  },
  name: 'hx',
  plugins: [
    json(),
    coffee(),
    buble(),
    resolveHexagon(),
    includePaths(includePathOptions),
    progress(progressOptions)
  ]
}

export default [
  libraryConfig,
  testConfig,
{'fraction_non_alphanumeric': 0.17673618576650182, 'fraction_numerical': 0.0, 'mean_word_length': 2.8766666666666665, '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': '5127556', 'n_tokens_mistral': 1627, 'n_tokens_neox': 1624, 'n_words': 314}