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"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@trivago/parallel-webpack@3.0.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var workerFarm = require('worker-farm'),\n    Ajv = require('ajv'),\n    Promise = require('bluebird'),\n    chalk = require('chalk'),\n    assign = require('lodash.assign'),\n    pluralize = require('pluralize'),\n    schema = require('./schema.json'),\n    loadConfigurationFile = require('./src/loadConfigurationFile').default,\n    startWatchIPCServer = require('./src/watchModeIPC').startWatchIPCServer;\n\nvar ajv = new Ajv({\n    allErrors: true,\n    coerceTypes: true,\n    removeAdditional: 'all',\n    useDefaults: true\n});\nvar validate = ajv.compile(schema);\n\nfunction notSilent(options) {\n    return !options.json;\n}\n\nfunction startFarm(config, configPath, options, runWorker, callback) {\n    return Promise.resolve(config).then(function(config) {\n        config = Array.isArray(config) ? config : [config];\n        options = options || {};\n\n        // When in watch mode and a callback is provided start IPC server to invoke callback\n        // once all webpack configurations have been compiled\n        if (options.watch) {\n            startWatchIPCServer(callback, Object.keys(config));\n        }\n\n        if(notSilent(options)) {\n            console.log(chalk.blue('[WEBPACK]') + ' Building ' + chalk.yellow(config.length) + ' ' + pluralize('target', config.length));\n        }\n\n        var builds = config.map(function (c, i) {\n            return runWorker(configPath, options, i, config.length);\n        });\n        if(options.bail) {\n            return Promise.all(builds);\n        } else {\n            return Promise.settle(builds).then(function(results) {\n                return Promise.all(results.map(function (result) {\n                    if(result.isFulfilled()) {\n                        return result.value();\n                    }\n                    return Promise.reject(result.reason());\n                }));\n            });\n        }\n    })\n}\n\n/**\n * Runs the specified webpack configuration in parallel.\n * @param {String} configPath The path to the webpack.config.js\n * @param {Object} options\n * @param {Boolean} [options.watch=false] If `true`, Webpack will run in\n *   `watch-mode`.\n * @param {Number} [options.maxCallsPerWorker=Infinity] The maximum amount of calls\n *   per parallel worker\n * @param {Number} [options.maxConcurrentWorkers=require('os').cpus().length] The\n *   maximum number of parallel workers\n * @param {Number} [options.maxConcurrentCallsPerWorker=10] The maximum number of\n *   concurrent call per prallel worker\n * @param {Number} [options.maxConcurrentCalls=Infinity] The maximum number of\n *   concurrent calls\n * @param {Number} [options.maxRetries=0] The maximum amount of retries\n *   on build error\n * @param {Function} [callback] A callback to be invoked once the build has\n *   been completed\n * @return {Promise} A Promise that is resolved once all builds have been\n *   created\n */\nfunction run(configPath, options, callback) {\n    var config,\n        argvBackup = process.argv,\n        farmOptions = assign({}, options);\n    options = options || {};\n    if(options.colors === undefined) {\n        options.colors = chalk.supportsColor;\n    }\n    if(!options.argv) {\n        options.argv = [];\n    }\n    options.argv.unshift(process.execPath, 'parallel-webpack');\n    try {\n        process.argv = options.argv;\n        config = loadConfigurationFile(configPath);\n        process.argv = argvBackup;\n    } catch(e) {\n        process.argv = argvBackup;\n        return Promise.reject(new Error(\n            chalk.red('[WEBPACK]') + ' Could not load configuration file ' + chalk.underline(configPath) + \"\\n\"\n            + e\n        ));\n    }\n\n    if (!validate(farmOptions)) {\n        return Promise.reject(new Error(\n          'Options validation failed:\\n' +\n          validate.errors.map(function(error) {\n            return 'Property: \"options' + error.dataPath + '\" ' + error.message;\n          }).join('\\n')\n        ));\n    }\n\n    var workers = workerFarm(farmOptions, require.resolve('./src/webpackWorker'));\n\n    var shutdownCallback = function() {\n        if (notSilent(options)) {\n            console.log(chalk.red('[WEBPACK]') + ' Forcefully shutting down');\n        }\n        workerFarm.end(workers);\n    };\n\n    function keepAliveAfterFinishCallback(cb){\n        if(options.keepAliveAfterFinish){\n            setTimeout(cb, options.keepAliveAfterFinish);\n        } else {\n            cb();\n        }\n    }\n\n    function finalCallback(){\n        workerFarm.end(workers);\n        process.removeListener(\"SIGINT\", shutdownCallback);\n    }\n\n    process.on('SIGINT', shutdownCallback);\n\n    var startTime = Date.now();\n    var farmPromise = startFarm(\n        config,\n        configPath,\n        options,\n        Promise.promisify(workers),\n        callback\n    ).error(function(err) {\n        if(notSilent(options)) {\n            console.log('%s Build failed after %s seconds', chalk.red('[WEBPACK]'), chalk.blue((Date.now() - startTime) / 1000));\n        }\n        return Promise.reject(err);\n    }).then(function (results) {\n        if(notSilent(options)) {\n            console.log('%s Finished build after %s seconds', chalk.blue('[WEBPACK]'), chalk.blue((Date.now() - startTime) / 1000));\n        }\n        results = results.filter(function(result) {\n            return result;\n        });\n        if(results.length) {\n            return results;\n        }\n    }).finally(function() {\n        keepAliveAfterFinishCallback(finalCallback);\n    });\n\n    if (!options.watch) {\n        farmPromise.asCallback(callback);\n    }\n    return farmPromise;\n}\n\nmodule.exports = {\n    createVariants: require('./src/createVariants'),\n    run: run\n};\n"]}