text: const path = require('path');
  const fs = require('fs');
  
  const appDirectory = fs.realpathSync(process.cwd());
  const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);
  
  const moduleFileExtensions = [
    'web.mjs',
    'mjs',
    'web.js',
    'js',
    'web.ts',
    'ts',
    'web.tsx',
    'tsx',
    'json',
    'web.jsx',
    'jsx',
  ];
  
  // Resolve file paths in the same order as webpack
  const resolveModule = (resolveFn, filePath) => {
    // eslint-disable-next-line no-shadow
    const extension = moduleFileExtensions.find((extension) => fs.existsSync(resolveFn(`${filePath}.${extension}`)));
  
    if (extension) {
      return resolveFn(`${filePath}.${extension}`);
    }
  
    return resolveFn(`${filePath}.js`);
  };
  
  const resolveOwn = (relativePath) => path.resolve(__dirname, '..', relativePath);
  
  module.exports = {
    dotenv: resolveApp('react/.env'),
    selfDotenv: resolveOwn('../.env'),
    appPath: resolveApp('.'),
    appBuild: resolveApp('build'),
    appPublic: resolveApp('public'),
    appHtml: resolveOwn('index.template.html'),
    appFavicon: resolveOwn('favicon.ico'),
    appIndexJs: resolveModule(resolveApp, 'src/index'),
    appPackageJson: resolveApp('package.json'),
    appSrc: resolveApp('react'),
    appTsConfig: resolveApp('tsconfig.json'),
    appJsConfig: resolveApp('jsconfig.json'),
    yarnLockFile: resolveApp('yarn.lock'),
    proxySetup: resolveApp('src/setupProxy.js'),
    appNodeModules: resolveApp('node_modules'),
    ownPath: resolveOwn('.'),
    ownRoot: resolveOwn('../'),
    ownNodeModules: resolveOwn('node_modules'), // This is empty on npm 3
    appTypeDeclarations: resolveApp('src/react-app-env.d.ts'),
    ownTypeDeclarations: resolveOwn('lib/react-app.d.ts'),
  };
  module.exports.moduleFileExtensions = moduleFileExtensions;
  