I have two React apps I want to serve with one CloudFront distribution. They both rely on react-router for navigation.
I have two S3 buckets configured as origins. The default (*) behaviour is set to my one bucket that hosts the landing page. I want certain other URLs (like /dashboard, /task) to use my other bucket.
This works fine setting up behaviours that pattern match those certain paths, but I'm stuck on one thing. Building a React app defaults scripts that the app needs to run to a "static" directory. I have to set a behaviour static* for one or the other and only the one that the behaviour points to works.
Is there anything I can do to work around this? From searching I haven't found any way to tell npm run-script build to build an app that uses a differently named static directory.
Thank you.