title: How to ignore spec files and mock files in production build in Angular 6
body: <p>I m trying to compile in production my angular application and I m receiving this error: </p>
  
  <blockquote>
    <p>Cannot determine the module for class TranslateMockPipe in
    /src/testing/translate.service.spec.ts! Add TranslateMockPipe to the
    NgModule to fix it.</p>
  </blockquote>
  
  <p>this <code>TranslateMockPipe</code> class is a common class that I declared and I m using it in all my test files in order to avoid repeating the same line of code in all the test cases</p>
  
  <p>the code of the class: </p>
  
  <pre><code>@Pipe({ name: "translate" })
  class TranslateMockPipe {
      transform = (ss) =&gt; ss
  }
  </code></pre>
  
  <p>I m using it in my test like this:</p>
  
  <pre><code>TestBed.configureTestingModule({
              declarations: [
                  DemoComponent,
                  TranslateMockPipe
              ]
  })
  </code></pre>
  
  <p>If I run the project everything goes well, and my test pass without issues but fail when I try to compile for production</p>
  
  <p>How I can ignore this kind of fake classes  for production build?</p>