Skip to content

Instantly share code, notes, and snippets.

@pekkis
Created September 17, 2018 10:44
Show Gist options
  • Save pekkis/7196f95aee473acb56a35a62bbee7b33 to your computer and use it in GitHub Desktop.
Save pekkis/7196f95aee473acb56a35a62bbee7b33 to your computer and use it in GitHub Desktop.
const { Map } = require("immutable");
function getEnvironmentVariables() {
return Map(process.env)
.filter((v, k) => k === "NODE_ENV" || k.startsWith("REACT_APP_"))
.map((v, k) => JSON.stringify(v))
.toJS();
}
module.exports = {
getEnvironmentVariables
};
// ja tämän funkkarin tuleman voi suoraan heittää sille define plugarille sit:
"process.env": getEnvironmentVariables()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment