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};;
I usually have the following setup, a file for each environment, stored in each branch
vars.js
- local variables vars.production.js
- production variables Then my build process to deploy to production on CI/CD will replace vars.js with vars.production.js ie current build branch = production
One possible way to do it
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.