PHP 7.4.33
Preview: react-native.config.js Size: 2.62 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/react-native.config.js
/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @format
 */

'use strict';

// React Native shouldn't be exporting itself like this, the Community Template should be be directly
// depending on and injecting:
// - @react-native-community/cli-platform-android
// - @react-native-community/cli-platform-ios
// - @react-native/community-cli-plugin (via the @react-native/core-cli-utils package)
// - codegen command should be inhoused into @react-native-community/cli
//
// This is a temporary workaround.

const verbose = process.env.DEBUG && process.env.DEBUG.includes('react-native');

let android;
try {
  android = require('@react-native-community/cli-platform-android');
} catch {
  if (verbose) {
    console.warn(
      '@react-native-community/cli-platform-android not found, the react-native.config.js may be unusable.',
    );
  }
}

let ios;
try {
  ios = require('@react-native-community/cli-platform-ios');
} catch {
  if (verbose) {
    console.warn(
      '@react-native-community/cli-platform-ios not found, the react-native.config.js may be unusable.',
    );
  }
}

const commands = [];

const {
  bundleCommand,
  startCommand,
} = require('@react-native/community-cli-plugin');
commands.push(bundleCommand, startCommand);

const codegenCommand = {
  name: 'codegen',
  options: [
    {
      name: '--path <path>',
      description: 'Path to the React Native project root.',
      default: process.cwd(),
    },
    {
      name: '--platform <string>',
      description:
        'Target platform. Supported values: "android", "ios", "all".',
      default: 'all',
    },
    {
      name: '--outputPath <path>',
      description: 'Path where generated artifacts will be output to.',
    },
    {
      name: '--source <string>',
      description: 'Whether the script is invoked from an `app` or a `library`',
      default: 'app',
    },
  ],
  func: (argv, config, args) =>
    require('./scripts/codegen/generate-artifacts-executor').execute(
      args.path,
      args.platform,
      args.outputPath,
      args.source,
    ),
};

commands.push(codegenCommand);

const config = {
  commands,
  platforms: {},
};

if (ios != null) {
  config.commands.push(...ios.commands);
  config.platforms.ios = {
    projectConfig: ios.projectConfig,
    dependencyConfig: ios.dependencyConfig,
  };
}

if (android != null) {
  config.commands.push(...android.commands);
  config.platforms.android = {
    projectConfig: android.projectConfig,
    dependencyConfig: android.dependencyConfig,
  };
}

module.exports = config;

Directory Contents

Dirs: 15 × Files: 14
Name Size Perms Modified Actions
android DIR
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
flow DIR
- drwxr-xr-x 2025-03-28 11:04:42
Edit Download
gradle DIR
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
jest DIR
- drwxr-xr-x 2025-03-28 11:04:42
Edit Download
Libraries DIR
- drwxr-xr-x 2025-03-28 11:04:42
Edit Download
- drwxr-xr-x 2025-03-28 11:04:46
Edit Download
React DIR
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
scripts DIR
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
sdks DIR
- drwxr-xr-x 2025-03-28 11:04:42
Edit Download
src DIR
- drwxr-xr-x 2025-03-28 11:04:41
Edit Download
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
types DIR
- drwxr-xr-x 2025-03-28 11:04:43
Edit Download
801 B lrw-r--r-- 2025-03-28 11:04:43
Edit Download
7.21 KB lrwxr-xr-x 2025-03-28 11:04:42
Edit Download
24 B lrw-r--r-- 2025-03-28 11:04:43
Edit Download
31.30 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
792 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
737 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
1.06 KB lrw-r--r-- 2025-03-28 11:04:38
Edit Download
4.29 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
5.68 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
2.62 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
2.57 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
6.67 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
299 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
954 B lrw-r--r-- 2025-03-28 11:04:43
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).