Change hard coded url constants for different environments via webpack
<p>I have a <code>ApiCaller.js</code> module which generate calls to our api server to get data. It has const field <strong>API_URL</strong> which points to server url.
This <strong>API_URL</strong> const changes for <strong>dev</strong> and <strong>prod</strong> environments.</p>

<p>So when I need to deploy to <strong>dev</strong> environment I need to change that url (<strong>API_URL</strong>) manually to point to <strong>dev-api-server</strong> and vice-versa. </p>

<p>I want these configuration parameters outside the code and during build process I want to change them dynamically so that I can build with different settings.</p>

<p>I am using <strong>webpack</strong> to bundle my javascript, html, css files.</p>