summaryrefslogtreecommitdiff
path: root/support/build/aggregate-build.js
blob: 7269291c3fbb744cebe3390bdc3072c0005651cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import compileModules from './compile-modules';
import {rollup} from 'rollup';
import rimraf from 'rimraf/rimraf';

export default function buildBundle(options) {
    function bundle() {
        rollup({
            entry: options.outpath + '/index.js'
        }).then(function ( bundle ) {
            bundle.write({
                format: options.format,
                moduleName: 'async',
                dest: options.outfile
            });
            rimraf.sync(options.outpath);
        }).catch(console.error);
    }

    compileModules(bundle, options);
}