"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var libs_1 = require("./libs");
var util_1 = require("./util");
function electronRendererBundler(settings, options) {
    if (options === void 0) { options = {}; }
    var _a = options.prod, prod = _a === void 0 ? false : _a;
    var electron = settings.electron;
    var out = electron.out(prod);
    var entry = electron.entry.renderer;
    return createBundler(entry, electron.data.bundle, prod, tslib_1.__assign({ outDir: out.renderer.dir, target: 'electron' }, options.parcel));
}
exports.electronRendererBundler = electronRendererBundler;
function webBundler(settings, options) {
    if (options === void 0) { options = {}; }
    var _a = options.prod, prod = _a === void 0 ? false : _a;
    var web = settings.web;
    var out = web.out(prod);
    var entry = web.entry;
    return createBundler(entry, web.data.bundle, prod, tslib_1.__assign({ outDir: out.dir, target: 'browser' }, options.parcel));
}
exports.webBundler = webBundler;
function createBundler(entry, bundlerConfig, prod, options) {
    var args = util_1.toBundlerArgs(bundlerConfig);
    return new libs_1.ParcelBundler(entry, tslib_1.__assign({ minify: prod, watch: !prod, sourceMaps: args.sourcemaps, scopeHoist: args.treeshake }, options));
}
//# sourceMappingURL=parcel.js.map