@leafage/toolkit
Version:
The React Server Side Render Framework
54 lines (51 loc) • 1.61 kB
JavaScript
/**
* @leafage/toolkit v1.3.2
*
* Copyright (c) Leafage.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
import { asyncToGenerator as _asyncToGenerator, regenerator as _regenerator } from '../_virtual/_rollupPluginBabelHelpers.js';
import * as c12 from 'c12';
import common from './common.js';
import builder from './builder.js';
import server from './server.js';
import { mergeProps } from '../utils.js';
var getConfig = function getConfig() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return mergeProps(common, {
builder: builder,
server: server
}, options);
};
var loadConfig = /*#__PURE__*/function () {
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
var options,
_yield$c12$loadConfig,
config,
_args = arguments;
return _regenerator().w(function (_context) {
while (1) switch (_context.n) {
case 0:
options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
_context.n = 1;
return c12.loadConfig(mergeProps(options, {
name: 'leafage',
dotenv: false,
defaults: getConfig()
}));
case 1:
_yield$c12$loadConfig = _context.v;
config = _yield$c12$loadConfig.config;
return _context.a(2, config);
}
}, _callee);
}));
return function loadConfig() {
return _ref.apply(this, arguments);
};
}();
export { getConfig, loadConfig };