Using Sage 8.4.0.
We have our own vagrant solution that lets each team member dictate the IP for their VM.
The problem is I have config.devUrl
hard coded in manifest.json making it hard for each of us to use gulp watch
unless we just agree to all use the same IP. That’s fine, but if there was some way to make it more flexible, that’d be better.
Thanks.
Why not use a hostname with an actual URL rather than an IP?
No reason I guess. Just interested in the possibility of removing that requirement altogether.
I suppose you could look into node.js environment variables.
https://nodejs.org/api/process.html#process_process_env
To set the env, you can use something like https://www.npmjs.com/package/dotenv
Then just add the variable to your .env
file.
DEV_URL=192.168.56.10
Then do something like this in gulpfile.js
proxy: process.env.DEV_URL // gulpfile.js ~L248
ezpz
1 Like
awesome. I’ll take a look.