How to use the @expo/config.getWebOutputPath function in @expo/config

To help you get started, we’ve selected a few @expo/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 expo / expo-cli / packages / expo-optimize / src / assets.ts View on Github external
async function getAssetFilesAsync(
  projectDir: string,
  options: OptimizationOptions
): Promise<{ allFiles: string[]; selectedFiles: string[] }> {
  const { exp } = await readConfigJsonAsync(projectDir, true, true);
  const webOutputPath = await getWebOutputPath(exp);
  const { assetBundlePatterns } = exp;
  const globOptions = {
    cwd: projectDir,
    ignore: ['**/node_modules/**', '**/ios/**', '**/android/**', `**/${webOutputPath}/**`],
  };

  // All files must be returned even if flags are passed in to properly update assets.json
  const allFiles: string[] = [];
  const patterns = assetBundlePatterns || ['**/*'];
  patterns.forEach((pattern: string) => {
    allFiles.push(...glob.sync(pattern, globOptions));
  });
  // If --include is passed in, only return files matching that pattern
  const included =
    options && options.include ? [...glob.sync(options.include, globOptions)] : allFiles;
  const toExclude = new Set();