<commit_before>import babel from 'rollup-plugin-babel';
import replace from 'rollup-plugin-replace';
import bundleSize from 'rollup-plugin-bundle-size';
import { terser } from 'rollup-plugin-terser';

const IS_DEV = process.env.NODE_ENV === 'development';
const dir = IS_DEV ? 'tests/visual/dist' : 'dist';

const umdBundle = minify => ({
  input: 'src/index.js',
  plugins: [
    babel(),
    replace({
      __DEV__: "process.env.NODE_ENV !== 'production'",
    }),
    minify && terser(),
    bundleSize(),
  ].filter(Boolean),
  output: {
    name: 'Popper',
    file: `${dir}/umd/index${minify ? '.min' : ''}.js`,
    format: 'umd',
    sourcemap: true,
  },
});

const esBundle = minify => ({
  input: 'src/index.js',
  plugins: [
    babel(),
    replace({
      __DEV__: "process.env.NODE_ENV !== 'production'",
    }),
    minify && terser(),
    bundleSize(),
  ].filter(Boolean),
  output: {
    name: 'Popper',
    file: `${dir}/es/index${minify ? '.min' : ''}.js`,
    format: 'es',
    sourcemap: true,
  },
});

const cjsBundle = minify => ({
  input: 'src/index.js',
  plugins: [
    babel(),
    replace({
      __DEV__: "process.env.NODE_ENV !== 'production'",
    }),
    minify && terser(),
    bundleSize(),
  ].filter(Boolean),
  output: {
    file: `${dir}/cjs/index${minify ? '.min' : ''}.js`,
    format: 'cjs',
    sourcemap: true,
  },
});

const devBundle = () => ({
  input: 'src/index.js',
  plugins: [
    babel(),
    replace({
      __DEV__: 'true',
    }),
  ],
  output: {
    name: 'Popper',
    file: `${dir}/es/index.js`,
    format: 'es',
    sourcemap: true,
  },
});

const builds = IS_DEV
  ? [devBundle()]
  : [
      umdBundle(),
      umdBundle(true),
      esBundle(),
      esBundle(true),
      cjsBundle(),
      cjsBundle(true),
    ];

export default builds;
<commit_msg>fix: remove minification for cjs/es, create two umd bundles<commit_after>import babel from 'rollup-plugin-babel';
import replace from 'rollup-plugin-replace';
import bundleSize from 'rollup-plugin-bundle-size';
import { terser } from 'rollup-plugin-terser';

const IS_DEV = process.env.NODE_ENV === 'development';
const dir = IS_DEV ? 'tests/visual/dist' : 'dist';

const createUmdBundle = ({ minify } = {}) => ({
  input: 'src/index.js',
  plugins: [
    babel(),
    replace({
      __DEV__: minify ? 'false' : 'true',
    }),
    minify && terser(),
    bundleSize(),
  ].filter(Boolean),
  output: {
    name: 'Popper',
    file: `${dir}/umd/index${minify ? '.min' : ''}.js`,
    format: 'umd',
    sourcemap: true,
  },
});

const esBundle = {
  input: 'src/index.js',
  plugins: [
    babel(),
    replace({
      __DEV__: "process.env.NODE_ENV !== 'production'",
    }),
    bundleSize(),
  ].filter(Boolean),
  output: {
    name: 'Popper',
    file: `${dir}/es/index.js`,
    format: 'es',
    sourcemap: true,
  },
};

const cjsBundle = {
  input: 'src/index.js',
  plugins: [
    babel(),
    replace({
      __DEV__: "process.env.NODE_ENV !== 'production'",
    }),
    bundleSize(),
  ].filter(Boolean),
  output: {
    file: `${dir}/cjs/index.js`,
    format: 'cjs',
    sourcemap: true,
  },
};

const devBundle = {
  input: 'src/index.js',
  plugins: [
    babel(),
    replace({
      __DEV__: 'true',
    }),
  ],
  output: {
    name: 'Popper',
    file: `${dir}/es/index.js`,
    format: 'es',
    sourcemap: true,
  },
};

const builds = IS_DEV
  ? [devBundle]
  : [createUmdBundle(), createUmdBundle({ minify: true }), esBundle, cjsBundle];

export default builds;

{'fraction_non_alphanumeric': 0.19863208891422057, 'fraction_numerical': 0.0, 'mean_word_length': 2.869900771775083, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '6110316', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1271, 'n_words': 263}