docs: function readConfig(options) {
    return new Promise((resolve, reject) => {
      const {
        type,
        config,
        importsStart = null,
        importsEnd = null,
        exportsStart = 'export default {',
        exportsEnd = '};',
        isArray = false,
      } = options;
  
      if (!config || !isPlainObject(config)) {
        return reject(new TypeError(t('SUPPLIED_CONFIG_IS_NOT_AN_OBJECT', {
          typeofConfig: typeof config,
        })));
      }
  
      const imports = importsStart ? [importsStart] : []; // Holds the import strings.
      const exports = [exportsStart]; // Holds the export strings.
  
      // eslint-disable-next-line global-require, import/no-dynamic-require
      const themePackage = require(`${themes.getPath()}/package.json`);
  
      if (
        (type === TYPE_PORTALS || type === TYPE_WIDGETS) &&
        has(themePackage.dependencies, 'react-loadable')
      ) {
        imports.push('import Loadable from \'react-loadable\';');
        imports.push('import Loading from \'@shopgate/pwa-common/components/Loading\';');
        imports.push('');
      }
  
      try {
        Object.keys(config).forEach((id) => {
          const component = config[id];
          const componentPath = isDev ? component.path.replace('/dist/', '/src/') : component.path;
  
          if (!componentExists(componentPath)) {
            return;
          }
  
          const variableName = getVariableName(id);
  
          const isPortalsOrWidgets = (
            (type === TYPE_PORTALS && component.target !== 'app.routes')
          || type === TYPE_WIDGETS
          );
  
          if (isPortalsOrWidgets && has(themePackage.dependencies, 'react-loadable')) {
            imports.push(`const ${variableName} = Loadable({\n  loader: () => import('${componentPath}'),\n  loading: Loading,\n});\n`);
          } else {
            imports.push(`import ${variableName} from '${componentPath}';`);
          }
  
          if (isArray) {
            exports.push(`  ${variableName},`);
            return;
          }
  
          exports.push(`  '${id}': ${variableName},`);
        });
      } catch (e) {
        return reject(e);
      }
  
      if (importsEnd) {
        imports.push(importsEnd);
      }
  
      exports.push(exportsEnd);
  
      return resolve({
        imports,
        exports,
      });
    });
  }