<commit_before>import babel from 'rollup-plugin-babel'
import builtins from 'rollup-plugin-node-builtins'
import commonjs from 'rollup-plugin-commonjs'
import globals from 'rollup-plugin-node-globals'
import json from 'rollup-plugin-json'
import replace from 'rollup-plugin-replace'
import resolve from 'rollup-plugin-node-resolve'
import sourcemaps from 'rollup-plugin-sourcemaps'
import uglify from 'rollup-plugin-uglify'
import pkg from '../../package.json'

/**
 * Return a Rollup configuration for the examples with `env`.
 *
 * @param {String} env
 * @return {Object}
 */

function configure(env) {
  const isDev = env === 'development'
  const isProd = env === 'production'

  return {
    input: 'examples/index.js',
    output: {
      file: isProd ? pkg.umdMin : pkg.umd,
      name: 'slate-examples',
      format: 'umd',
      exports: 'named',
      sourcemap: isDev,
    },
    watch: {
      include: ['examples/**', 'packages/*/lib/*.es.js'],
    },
    plugins: [
      // Allow Rollup to resolve modules from `node_modules`, since it only
      // resolves local modules by default.
      resolve({
        browser: true,
      }),

      // Allow Rollup to resolve CommonJS modules, since it only resolves ES2015
      // modules by default.
      commonjs({
        exclude: ['examples/**'],
        // HACK: Sometimes the CommonJS plugin can't identify named exports, so
        // we have to manually specify named exports here for them to work.
        // https://github.com/rollup/rollup-plugin-commonjs#custom-named-exports<commit_msg>update rollup examples config<commit_after>import babel from 'rollup-plugin-babel'
import builtins from 'rollup-plugin-node-builtins'
import commonjs from 'rollup-plugin-commonjs'
import globals from 'rollup-plugin-node-globals'
import json from 'rollup-plugin-json'
import replace from 'rollup-plugin-replace'
import resolve from 'rollup-plugin-node-resolve'
import sourcemaps from 'rollup-plugin-sourcemaps'
import uglify from 'rollup-plugin-uglify'
import pkg from '../../package.json'

/**
 * Return a Rollup configuration for the examples with `env`.
 *
 * @param {String} env
 * @return {Object}
 */

function configure(env) {
  const isDev = env === 'development'
  const isProd = env === 'production'

  return {
    input: 'examples/index.js',
    output: {
      file: isProd ? pkg.umdMin : pkg.umd,
      name: 'slate-examples',
      format: 'umd',
      exports: 'named',
      sourcemap: isDev,
    },
    watch: {
      include: ['examples/**', 'packages/*/lib/*.es.js'],
    },
    plugins: [
      // Allow Rollup to resolve modules from `node_modules`, since it only
      // resolves local modules by default.
      resolve({
        browser: true,
        preferBuiltins: true,
      }),

      // Allow Rollup to resolve CommonJS modules, since it only resolves ES2015
      // modules by default.
      commonjs({
        exclude: ['examples/**'],
        // HACK: Sometimes the CommonJS plugin can't identify named exports, so
        // we have to manually specify named exports here for them to work.
        // https://github.com/rollup/rollup-plugin-commonjs#custom-named-exports
{'fraction_non_alphanumeric': 0.1231838281743525, 'fraction_numerical': 0.002526847757422615, 'mean_word_length': 2.939054726368159, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5688352', 'n_tokens_mistral': 955, 'n_tokens_neox': 927, 'n_words': 290}