Update config injection to take the name of a config file at run-time rather than it being hardcoded

Viewed 111

I am using wbepack and trying to be more dynamic with the configs in my when building my application. It is a create-react-app project which has been ejected.

For example if I want to make a local build in my package.json file I have the following.

"build:local": "APPLICATION_ENV=local npm run build",

I would like to have a custom build where I can pass in a json file which it would then use that config.

"custom": "APPLICATION_ENV=custom CUSTOM_ENV=test.json npm run build",

I think it would be ok to get this to work, however is there anyway I can make the name of the json file dynamic enabling me to decide which json file to use as opposed to having to hard code it in my package.json.

in my head something like this:

npm run build:custom CUSTOM_CONFIG=hulkhogan.json

Does anyone have any idea how to approach this? Maybe something like this.

1 Answers
Related