How to use the metro-config/src/defaults/defaults.platforms function in metro-config

To help you get started, we’ve selected a few metro-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alan-ai / alan-sdk-reactnative / testtools / node_modules / metro / src / ModuleGraph / node-haste / node-haste.js View on Github external
const ModuleCache = require("./ModuleCache");

const defaults = require("metro-config/src/defaults/defaults");

const parsePlatformFilePath = require("../../node-haste/lib/parsePlatformFilePath");

const path = require("path");

const _require = require("../../node-haste/DependencyGraph/ModuleResolution"),
  ModuleResolver = _require.ModuleResolver;

const _require2 = require("jest-haste-map"),
  ModuleMap = _require2.ModuleMap;

const platforms = new Set(defaults.platforms);
const GENERIC_PLATFORM = "g";
const PACKAGE_JSON = path.sep + "package.json";
const NULL_MODULE = {
  path: "/",

  getPackage() {},

  isHaste() {
    throw new Error("not implemented");
  },

  getName() {
    throw new Error("not implemented");
  }
}; // This function maps the ModuleGraph data structure to jest-haste-map's ModuleMap
github Marwan01 / food-converter / node_modules / metro / src / ModuleGraph / node-haste / node-haste.js View on Github external
const ModuleCache = require("./ModuleCache");

const defaults = require("metro-config/src/defaults/defaults");

const parsePlatformFilePath = require("../../node-haste/lib/parsePlatformFilePath");

const path = require("path");

const _require = require("../../node-haste/DependencyGraph/ModuleResolution"),
  ModuleResolver = _require.ModuleResolver;

const _require2 = require("jest-haste-map"),
  ModuleMap = _require2.ModuleMap;

const platforms = new Set(defaults.platforms);
const GENERIC_PLATFORM = "g";
const PACKAGE_JSON = path.sep + "package.json";
const NULL_MODULE = {
  path: "/",

  getPackage() {},

  isHaste() {
    throw new Error("not implemented");
  },

  getName() {
    throw new Error("not implemented");
  }
}; // This function maps the ModuleGraph data structure to jest-haste-map's ModuleMap
github facebook / metro / packages / metro / src / ModuleGraph / node-haste / node-haste.js View on Github external
import type {Moduleish} from '../../node-haste/DependencyGraph/ResolutionRequest';
import type {ResolveFn, TransformedCodeFile} from '../types.flow';
import type {Extensions, Path} from './node-haste.flow';
import type {CustomResolver} from 'metro-resolver';

type ResolveOptions = {|
  assetExts: Extensions,
  extraNodeModules: {[id: string]: string},
  mainFields: $ReadOnlyArray,
  resolveRequest?: ?CustomResolver,
  +sourceExts: Extensions,
  transformedFiles: {[path: Path]: TransformedCodeFile},
  +platform: string,
|};

const platforms = new Set(defaults.platforms);

const GENERIC_PLATFORM = 'g';
const PACKAGE_JSON = path.sep + 'package.json';
const NULL_MODULE: Moduleish = {
  path: '/',
  getPackage(): void {},
  isHaste() {
    throw new Error('not implemented');
  },
  getName() {
    throw new Error('not implemented');
  },
};

// This function maps the ModuleGraph data structure to jest-haste-map's ModuleMap
const createModuleMap = ({files, helpers, moduleCache, sourceExts}) => {
github facebook / metro / packages / metro / src / ModuleGraph / node-haste / node-haste.js View on Github external
import type {Moduleish} from '../../node-haste/DependencyGraph/ResolutionRequest';
import type {ResolveFn, TransformedCodeFile} from '../types.flow';
import type {Extensions, Path} from './node-haste.flow';
import type {CustomResolver} from 'metro-resolver';

type ResolveOptions = {|
  assetExts: Extensions,
  extraNodeModules: {[id: string]: string, ...},
  mainFields: $ReadOnlyArray,
  resolveRequest?: ?CustomResolver,
  +sourceExts: Extensions,
  transformedFiles: {[path: Path]: TransformedCodeFile, ...},
  +platform: string,
|};

const platforms = new Set(defaults.platforms);

const GENERIC_PLATFORM = 'g';
const PACKAGE_JSON = path.sep + 'package.json';
const NULL_MODULE: Moduleish = {
  path: '/',
  getPackage(): void {},
  isHaste() {
    throw new Error('not implemented');
  },
  getName() {
    throw new Error('not implemented');
  },
};

// This function maps the ModuleGraph data structure to jest-haste-map's ModuleMap
const createModuleMap = ({files, helpers, moduleCache, sourceExts}) => {