How to ignore test files in webpack with ts-loader
<p>I have a project that runs the test files named "*.test.ts" with jest and ts-jest. This is fine but when I launch webpack, I get errors for the test files:</p>

<pre><code>ERROR in /some/path/note.test.ts
(27,3): error TS2304: Cannot find name '
</code></pre>

<p>How can I fix the webpack config to totally ignore test files ?</p>

<p>Here is the webpack config:</p>

<pre><code>const path = require ( 'path' )

module.exports =
{ entry: './src/boot.tsx'
, node:
  { __dirname: false
  }
, output:
  { path: path.resolve ( __dirname, 'app', 'build' )
  , filename: 'app.js'
  , publicPath: '/live-reload/'
  }
, devtool: 'source-map'
, resolve:
  { extensions: ['', '.js', '.ts', '.tsx']
  }
, module:
  { loaders:
    [ { test: /\.tsx?$/
      , exclude: /node_modules/
      , loader: 'ts-loader'
      }
    ]
  }
}
</code></pre>

<p>[EDIT]</p>

<p>I used the test function to log seen files and the test files do not appear in there, so the problem is not on webpack including the wrong files but on typescript misbehaving (because tests work fine with jest).</p>