1{"version":3,"file":"withConfigPlugins.js","names":["withConfigPlugins","config","skipPlugins","Array","isArray","plugins","length","withPlugins","serializeAfterStaticPlugins"],"sources":["../../src/plugins/withConfigPlugins.ts"],"sourcesContent":["import { ConfigPlugin, withPlugins } from '@expo/config-plugins';\n\nimport { serializeAfterStaticPlugins } from '../Serialize';\n\n/**\n * Resolves static plugins array as config plugin functions.\n *\n * @param config\n * @param projectRoot\n */\nexport const withConfigPlugins: ConfigPlugin<boolean> = (config, skipPlugins) => {\n  // @ts-ignore: plugins not on config type yet -- TODO\n  if (!Array.isArray(config.plugins) || !config.plugins?.length) {\n    return config;\n  }\n  if (!skipPlugins) {\n    // Resolve and evaluate plugins\n    // @ts-ignore: TODO: add plugins to the config schema\n    config = withPlugins(config, config.plugins);\n  } else {\n    // Delete the plugins array in case someone added functions or other values which cannot be automatically serialized.\n    delete config.plugins;\n  }\n  // plugins aren't serialized by default, serialize the plugins after resolving them.\n  return serializeAfterStaticPlugins(config);\n};\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,iBAAwC,GAAG,CAACC,MAAM,EAAEC,WAAW,KAAK;EAAA;EAC/E;EACA,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,MAAM,CAACI,OAAO,CAAC,IAAI,qBAACJ,MAAM,CAACI,OAAO,4CAAd,gBAAgBC,MAAM,GAAE;IAC7D,OAAOL,MAAM;EACf;EACA,IAAI,CAACC,WAAW,EAAE;IAChB;IACA;IACAD,MAAM,GAAG,IAAAM,4BAAW,EAACN,MAAM,EAAEA,MAAM,CAACI,OAAO,CAAC;EAC9C,CAAC,MAAM;IACL;IACA,OAAOJ,MAAM,CAACI,OAAO;EACvB;EACA;EACA,OAAO,IAAAG,wCAA2B,EAACP,MAAM,CAAC;AAC5C,CAAC;AAAC"}