Reputation: 3633
The front-end of my website has:
The file vars.js contains
var server = 'localhost:3000';
export {server};
I want my production branch to contain
var server = 'https://servername.com/';
export {server};;
Upvotes: 0
Views: 88
Reputation: 10722
I usually have the following setup, a file for each environment, stored in each branch
vars.js
- local variablesvars.production.js
- production variablesThen my build process to deploy to production on CI/CD will replace vars.js with vars.production.js i.e. current build branch = production
One possible way to do it
Upvotes: 3