<commit_before>import resolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import { terser } from 'rollup-plugin-terser';
import pkg from './package.json';

const EXTERNALS = [
    ...Object.keys(pkg.dependencies || {}),
    ...Object.keys(pkg.peerDependencies || {}),
];

const EXTENSIONS = ['.js', '.ts', '.tsx'];

const DEFAULT_OUTPUT = {
    exports: 'default',
    globals: {
        'fast-equals': 'fe',
        'fast-stringify': 'stringify',
        'micro-memoize': 'memoize',
    },
    name: pkg.name,
    sourcemap: true,
};

const DEFAULT_CONFIG = {
    external: EXTERNALS,
    input: 'src/index.ts',
    output: [
        { ...DEFAULT_OUTPUT, file: pkg.browser, format: 'umd' },
        { ...DEFAULT_OUTPUT, file: pkg.main, format: 'cjs' },
        { ...DEFAULT_OUTPUT, file: pkg.module, format: 'es' },
    ],
    plugins: [
        resolve({
            extensions: EXTENSIONS,
            mainFields: ['module', 'jsnext:main', 'main'],
        }),
        babel({
            exclude: 'node_modules/**',
            extensions: EXTENSIONS,
            include: ['src/*'],
        }),
    ],
};

export default [
    DEFAULT_CONFIG,
    {
        ...DEFAULT_CONFIG,
        output: {
            ...DEFAULT_OUTPUT,
            file: pkg.browser.replace('.js', '.min.js'),
            format: 'umd',
        },
        plugins: [...DEFAULT_CONFIG.plugins, terser()],
    },
];<commit_msg>leverage explicit `babelHelpers` option for babel rollup plugin<commit_after>import resolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import { terser } from 'rollup-plugin-terser';
import pkg from './package.json';

const EXTERNALS = [
    ...Object.keys(pkg.dependencies || {}),
    ...Object.keys(pkg.peerDependencies || {}),
];

const EXTENSIONS = ['.js', '.ts', '.tsx'];

const DEFAULT_OUTPUT = {
    exports: 'default',
    globals: {
        'fast-equals': 'fe',
        'fast-stringify': 'stringify',
        'micro-memoize': 'memoize',
    },
    name: pkg.name,
    sourcemap: true,
};

const DEFAULT_CONFIG = {
    external: EXTERNALS,
    input: 'src/index.ts',
    output: [
        { ...DEFAULT_OUTPUT, file: pkg.browser, format: 'umd' },
        { ...DEFAULT_OUTPUT, file: pkg.main, format: 'cjs' },
        { ...DEFAULT_OUTPUT, file: pkg.module, format: 'es' },
    ],
    plugins: [
        resolve({
            extensions: EXTENSIONS,
            mainFields: ['module', 'jsnext:main', 'main'],
        }),
        babel({
            babelHelpers: 'bundled',
            exclude: 'node_modules/**',
            extensions: EXTENSIONS,
            include: ['src/*'],
        }),
    ],
};

export default [
    DEFAULT_CONFIG,
    {
        ...DEFAULT_CONFIG,
        output: {
            ...DEFAULT_OUTPUT,
            file: pkg.browser.replace('.js', '.min.js'),
            format: 'umd',
        },
        plugins: [...DEFAULT_CONFIG.plugins, terser()],
    },
];
{'fraction_non_alphanumeric': 0.17708685366677931, 'fraction_numerical': 0.0, 'mean_word_length': 2.135593220338983, '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': '7173298', 'n_tokens_mistral': 951, 'n_tokens_neox': 924, 'n_words': 191}