You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.0 KiB

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.withPlugins = void 0;
function _assert() {
const data = _interopRequireDefault(require("assert"));
_assert = function () {
return data;
};
return data;
}
function _withStaticPlugin() {
const data = require("./withStaticPlugin");
_withStaticPlugin = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Resolves a list of plugins.
*
* @param config exported config
* @param plugins list of config config plugins to apply to the exported config
*/
const withPlugins = (config, plugins) => {
(0, _assert().default)(Array.isArray(plugins), 'withPlugins expected a valid array of plugins or plugin module paths');
return plugins.reduce((prev, plugin) => (0, _withStaticPlugin().withStaticPlugin)(prev, {
plugin
}), config);
};
exports.withPlugins = withPlugins;
//# sourceMappingURL=withPlugins.js.map