1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = mergeCustomConfig;
|
7 |
|
8 | require("core-js/modules/es6.array.from");
|
9 |
|
10 | require("core-js/modules/es6.symbol");
|
11 |
|
12 | require("core-js/modules/web.dom.iterable");
|
13 |
|
14 | var _fs = require("fs");
|
15 |
|
16 | function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
17 |
|
18 | function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
19 |
|
20 | function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
21 |
|
22 | function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
23 |
|
24 | function mergeCustomConfig(webpackConfig, customConfigPath) {
|
25 | if (!(0, _fs.existsSync)(customConfigPath)) {
|
26 | return webpackConfig;
|
27 | }
|
28 |
|
29 | var customConfig = require(customConfigPath);
|
30 |
|
31 | if (typeof customConfig === 'function') {
|
32 | return customConfig.apply(void 0, [webpackConfig].concat(_toConsumableArray(Array.prototype.slice.call(arguments).slice(2))));
|
33 | }
|
34 |
|
35 | throw new Error("Return of ".concat(customConfigPath, " must be a function."));
|
36 | } |
\ | No newline at end of file |