diff --git a/packages/react-server/core/config.js b/packages/react-server/core/config.js index d2048f358..c0fb1c293 100644 --- a/packages/react-server/core/config.js +++ b/packages/react-server/core/config.js @@ -10,12 +10,18 @@ if (SERVER_SIDE) { module.exports = function () { // only read out the config once, and then cache it. -sra. if (null === config) { - /*eslint-disable no-process-env */ - if (process.env.REACT_SERVER_CONFIGS) { + + //eslint-disable-next-line no-process-env + if (process.env.REACT_SERVER_CONFIG_SOURCE) { + var path = require('path'); + //eslint-disable-next-line no-process-env + config = require(path.join(process.cwd(), process.env.REACT_SERVER_CONFIG_SOURCE)); + } + //eslint-disable-next-line no-process-env + else if (process.env.REACT_SERVER_CONFIGS) { var fs = require("fs"); - /*eslint-disable no-process-env */ + //eslint-disable-next-line no-process-env var configFile = fs.readFileSync(process.env.REACT_SERVER_CONFIGS + "/config.json"); - /*eslint-disable no-process-env */ config = Object.freeze(JSON.parse(configFile)); } else { config = Object.freeze({});