1 line
1.7 KiB
Plaintext
1 line
1.7 KiB
Plaintext
{"version":3,"sources":["../../src/plugins/withConfigPlugins.ts"],"names":["withConfigPlugins","config","skipPlugins","Array","isArray","plugins","length"],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,iBAAwC,GAAG,CAACC,MAAD,EAASC,WAAT,KAAyB;AAAA;;AAC/E;AACA,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcH,MAAM,CAACI,OAArB,CAAD,IAAkC,qBAACJ,MAAM,CAACI,OAAR,4CAAC,gBAAgBC,MAAjB,CAAtC,EAA+D;AAC7D,WAAOL,MAAP;AACD;;AACD,MAAI,CAACC,WAAL,EAAkB;AAChB;AACA;AACAD,IAAAA,MAAM,GAAG,kCAAYA,MAAZ,EAAoBA,MAAM,CAACI,OAA3B,CAAT;AACD,GAJD,MAIO;AACL;AACA,WAAOJ,MAAM,CAACI,OAAd;AACD,GAZ8E,CAa/E;;;AACA,SAAO,8CAA4BJ,MAA5B,CAAP;AACD,CAfM","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"],"file":"withConfigPlugins.js"} |