title: In Angular 9, how can I replace the configuration file in assets folder during an ng build?
body: <p>I have an <code>Angular 6</code> project which I now upgraded to <code>Angular 9</code>. After upgrading I am not able to replace the .json configuration file in <code>assets</code> folder with a configuration file in <code>environments</code> folder.
  I have several configuration files in the environments folder corresponding to different staging environments.
  While the application is build using the below command,</p>
  
  <pre><code>ng build --prod --base-href=/ --configuration=staging_&lt;number&gt;
  </code></pre>
  
  <p>All the replacement list is mentioned in angular.json like,</p>
  
  <pre><code>{
    ...
    "projects":{
    ...
      "architect":{
      ...
        "build":{
        ...
        "configurations"{
          "staging_&lt;number&gt;": {
                "budgets": [
                  {
                    "type": "anyComponentStyle",
                    "maximumWarning": "6kb"
                  }
                ],
                "fileReplacements": [
                  {
                    "replace": "src/assets/appsettings_config.json",
                    "with": "src/environments/appsettings_config_stg_&lt;number&gt;.json"
                  }
                ],
                "sourceMap": true
               ..
  </code></pre>
  
  <p>Before upgrading the replacements were working fine.
  Now when I run the above command the application is build with the same configuration file which is already in the assets folder. ie, <code>appsettings_config.json</code> and not <code>appsettings_config_stg_&lt;number&gt;.json</code>.
  What could have been the difference between Angular version 6 and 9 in the file replacement functionality?</p>