1 | import "core-js/modules/es6.array.from";
|
2 | import "core-js/modules/es6.symbol";
|
3 | import "core-js/modules/web.dom.iterable";
|
4 | import "core-js/modules/es6.array.is-array";
|
5 |
|
6 | function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
7 |
|
8 | function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
9 |
|
10 | function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
11 |
|
12 | 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; } }
|
13 |
|
14 | import { existsSync } from 'fs';
|
15 | export default function mergeCustomConfig(webpackConfig, customConfigPath) {
|
16 | if (!existsSync(customConfigPath)) {
|
17 | return webpackConfig;
|
18 | }
|
19 |
|
20 | var customConfig = require(customConfigPath);
|
21 |
|
22 | if (typeof customConfig === 'function') {
|
23 | return customConfig.apply(void 0, [webpackConfig].concat(_toConsumableArray(Array.prototype.slice.call(arguments).slice(2))));
|
24 | }
|
25 |
|
26 | throw new Error("Return of ".concat(customConfigPath, " must be a function."));
|
27 | } |
\ | No newline at end of file |