/** * Parses cli arguments passed to the build command * into an object that can be used in the build process */ export function parsePassThruOptions( passThru?: Array, ): Record | undefined { if (!passThru || !Array.isArray(passThru) || passThru.length === 0) { return; } return passThru.reduce((acc, arg) => { const [_key, value] = arg.split('='); const key = _key.replace(/^-+/, ''); if (value) { acc[key] = value; } else { acc[key] = true; } return acc; }, {} as Record); }