title: Cannot set fileReplacements to replace folder content with Angular 11
body: <p>I'm using the angular cli config <code>fileReplacements</code> in <em>angular.json</em> file to replace a folder content, like this:</p>
  <pre><code>{
    &quot;projects&quot;: {
      &quot;myProject&quot;: {
        &quot;architect&quot;: {
          &quot;build&quot;: {
            &quot;configurations&quot;: {
              &quot;prod&quot;: {
                &quot;fileReplacements&quot;: [
                  {
                    &quot;replace&quot;: &quot;src/environments/environment.ts&quot;,
                    &quot;with&quot;: &quot;src/environments/environment.prod.ts&quot;
                  },
                  {
                    &quot;replace&quot;: &quot;node_modules/moment/locale/&quot;,
                    &quot;with&quot;: &quot;src/moment-js-locale/&quot;
                  }
                ]
              }
            }
          }
        }
      }
    }
  }
  </code></pre>
  <p>Notice that in <code>replace</code> value I'm using a path to a folder instead of a path to a file.
  This is working code for Angular 10.</p>
  <p>I upgraded to Angular 11 and now I'm getting an error when trying to build a prod version using this command:
  <code>ng build --prod</code></p>
  <p>The error I'm getting is:</p>
  <pre><code>Schema validation failed with the following errors:
    Data path &quot;.fileReplacements[1]&quot; should NOT have additional properties(replace).
    Data path &quot;.fileReplacements[1].replace&quot; should match pattern &quot;\.(([cm]?j|t)sx?|json)$&quot;.
    Data path &quot;.fileReplacements[1]&quot; should match exactly one schema in oneOf.
  </code></pre>
  <p>ESLint is showing me this warning:</p>
  <pre><code>String does not match the pattern of &quot;\.(([cm]?j|t)sx?|json)$&quot;.
  </code></pre>
  <p>What can I do with this? Is this an Angular 11 bug? should I use a different approach?</p>
  <p>Any help will be appreciated.</p>