I'm using create-react-app for my React project (ejected), and I've configured a proxy in package.json. But I don't want to have my credentials committed in this file. So I've added to npm using npm config set my_user xxxx.
I can see them in my ~/.npmrc, too.
"proxy": {
"/api/v3/": {
"target": "https://ourstagingserver.nl/",
"changeOrigin": true,
"ssl": false,
"secure": false,
"headers": {
"username": "$npm_config_my_user",
"password": "$npm_config_my_pass"
}
},
This doesn't work. The username and password are not used in the proxy requests.
But if I add this to "scripts":
"hello": "echo $npm_config_my_user $npm_config_my_pass
and run npm run hello, both are echoed...
Any ideas? Is this supposed to work or am I doing it wrong?
Thx! Gijs