title: Can we override webpack DefinePlugin 's variable in React application
body: <p>For a React application that is built with webpack, using DefinePlugin like this</p>
  <pre><code>plugins: options.plugins.concat([
      new webpack.DefinePlugin({
        'process.env': {
          REACT_APP_BASE_URL: JSON.stringify(&quot;my-url&quot;),
        },
        'anotherVar': {
          REACT_APP_BASE_URL: JSON.stringify(&quot;my-url&quot;),
        },
      }),
    ]),
  </code></pre>
  <p>My question is how / at which place can we override that variable <code>process.env = anotherVar</code> at <em>the earliest possible moment</em></p>
  <p>The React application is simply loaded like this</p>
  <pre><code>import { render } from 'react-dom';
  render(
     &lt;App /&gt;
  ,document.getElementById('root')
  );
  </code></pre>
  <p>More context of what I am trying to accomplish can be found <a href="https://stackoverflow.com/questions/68296875/reactjs-strategy-to-replace-webpack-environment-variable-at-deploy-time">here</a></p>