summaryrefslogtreecommitdiff
path: root/support/build/aggregate-build.js
blob: 25e87888eeafdb922b4a9b700925667640831c50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const {rollup} = require('rollup');
const nodeResolve = require('rollup-plugin-node-resolve');

module.exports = function buildBundle(options, cb) {
    const {format, entriesPath, outfile} = options;
    return rollup({
        entry: entriesPath + '/index.js',
        plugins: [ nodeResolve() ]
    })
    .then(function ( bundle ) {
        return bundle.write({
            format,
            moduleName: 'async',
            dest: outfile
        });
    })
    .then(() => cb())
    .catch(cb);
}