'Webpack: Create a separate file for storing API URLs

So right now an issue that I am facing is that I am storing the backend URL link in a .env file. Everytime I want to run a production build with different backend API I have to change the URL in the .env file and rebuild it. I was wondering if webpack supports anyway to include a config.js file or anything similar to store APIs or not so that I don't have to rerun npm run build just to change the API URLs.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source