1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = mergeCustomConfig;
|
7 |
|
8 | var _fs = require('fs');
|
9 |
|
10 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | function mergeCustomConfig(webpackConfig, customConfigPath) {
|
18 | if (!(0, _fs.existsSync)(customConfigPath)) {
|
19 | return webpackConfig;
|
20 | }
|
21 |
|
22 | var customConfig = require(customConfigPath);
|
23 |
|
24 | if (typeof customConfig === 'function') {
|
25 | return customConfig.apply(undefined, [webpackConfig].concat(_toConsumableArray([].concat(Array.prototype.slice.call(arguments)).slice(2))));
|
26 | }
|
27 |
|
28 | throw new Error('Return of ' + customConfigPath + ' must be a function.');
|
29 | }
|
30 | module.exports = exports['default']; |
\ | No newline at end of file |