I've built a reactjs site and trying to get it to be deployable.
right now all configuration is done via a config.js which is imported into all modules.
But when I build the app, this gets compiled into the deployment js and isn't configurable.
I want to have a separate file which a sys admin can configure various settings specific to their enviroment, such as the API end points (the app may not be running on the same server as the backend, and there will not be any access to DNS).
Is there a way to do this in react? I do not wish to use 3rd party libraries for this either.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…