We currently have a shared backend and frontend for two projects. Project B is essentially just a subset of Project A. It has all the same features except for a few that we restrict.
Using the dotenv module in node I am able to restrict loading of certain routes so the backend is all handled with environment variables. However, the frontend has a different primary color scheme (Blue instead of purple) and the logo is also different.
How would I go about loading these two differences depending on the environment/deployment? I tried putting all the common css in one file and from there importing them in. I guess the main difference in the frontend is that projA is a different theme then projB. Some of the components I can hide/show with a conditional in reacts render function.
main.scss:
@import _projA.scss
@import _projB.scss
Then in my webpack config I pass an environment variable through the npm build script and exclude either _projA or projB.scss. This still loads both and i'm guessing its because the main scss file imports both.
EDIT: https://medium.com/@trekinbami/using-environment-variables-in-react-6b0a99d83cf5