<commit_before><commit_msg>rollup for gulp<commit_after>const Path = require('./path');
const rollup = require('rollup');
const nodeResolve = require('./node-resolve');
const commonjs = require('rollup-plugin-commonjs');
const babel = require('rollup-plugin-babel');
const globalModules = require('global-modules');

/**
 * @param {string} inputPath
 * @param {string} distFileName
 * @param {Object} [babelOptions]
 * @param {Object} [resolveOptions]
 * @param {Object} [commonjsOptions]
 *
 * @return {Promise}
 */
module.exports = (inputPath, distFileName, babelOptions = {}, resolveOptions = {}, commonjsOptions = {}) => {
    return new Promise((resolve, reject) => {
        rollup.rollup({
            input: inputPath,
            plugins: [
                nodeResolve(resolveOptions),
                commonjs(commonjsOptions),
                babel(babelOptions),
            ],
        }).then((bundle) => {
            resolve(bundle.write({
                file: Path.bundle('/' + distFileName),
                format: 'iife',
                sourcemap: true,
                globals: globalModules,
            }));
        }).catch((e) => {
            reject(e);
        });
    });
};
{'fraction_non_alphanumeric': 0.15544472152950956, 'fraction_numerical': 0.0, 'mean_word_length': 2.3820224719101124, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6398521', 'n_tokens_mistral': 331, 'n_tokens_neox': 325, 'n_words': 67}