UNPKG

qu-build

Version:
31 lines (23 loc) 1.41 kB
import "core-js/modules/es6.string.iterator"; import "core-js/modules/es6.array.from"; import "core-js/modules/es6.regexp.to-string"; import "core-js/modules/es6.date.to-string"; import "core-js/modules/es7.symbol.async-iterator"; import "core-js/modules/es6.symbol"; import "core-js/modules/web.dom.iterable"; import "core-js/modules/es6.array.is-array"; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } 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; } } import { existsSync } from 'fs'; export default function mergeCustomConfig(webpackConfig, customConfigPath) { if (!existsSync(customConfigPath)) { return webpackConfig; } var customConfig = require(customConfigPath); if (typeof customConfig === 'function') { return customConfig.apply(void 0, [webpackConfig].concat(_toConsumableArray(Array.prototype.slice.call(arguments).slice(2)))); } throw new Error("Return of ".concat(customConfigPath, " must be a function.")); }