{"size": 1181, "ext": "js", "max_stars_repo_path": "build/node/common/tool/rollup.js", "max_stars_repo_name": "johnmilner/Penryn-Project", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "build/node/common/tool/rollup.js", "max_issues_repo_name": "johnmilner/Penryn-Project", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "build/node/common/tool/rollup.js", "max_forks_repo_name": "johnmilner/Penryn-Project", "max_forks_repo_forks_event_min_datetime": "2019-02-21T20:34:07.000Z", "max_forks_repo_forks_event_max_datetime": "2019-11-17T00:40:31.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 29.525, "max_line_length": 94, "alphanum_fraction": 0.4970364098}
const rollup = require('rollup')
const babel = require('rollup-plugin-babel')
const commonjs = require('rollup-plugin-commonjs') // Solve problems of node modules import
const resolve = require('rollup-plugin-node-resolve') // Solve problems of node modules import
const eslint = require('rollup-plugin-eslint')
const colors = require('colors')
const showError = require('./showError')

module.exports = opts => {
    rollup.rollup({
        input: opts.entry,
        plugins: [
            eslint({
                configFile: opts.eslint,
                exclude: ['node_modules/**', '**/Skylake.js']
            }),
            babel({
                babelrc: false,
                presets: [
                    ['es2015', { 'modules': false }]
                ],
                plugins: ['external-helpers']
            }),
            resolve(),
            commonjs({
                include: ['node_modules/**', '**/Skylake.js']
            })
        ]
    }).then(bundle => {
        bundle.write({
            file: opts.dest,
            format: 'cjs'
        })
    }).then(() => {
        opts.callback()
    }).catch(error => {
        showError(error)
    })
}
