title: webpack + TypeScript = all files checked instead of a single file
body: <p>I'd like to transpile <code>index.ts</code> with <strong>webpack</strong>, but it also checks <code>another.ts</code> while there is no dependency. Why ?</p>
  
  <p>Demo :</p>
  
  <pre><code>$ node_modules/webpack/bin/webpack.js
  </code></pre>
  
  <p>[...]</p>
  
  <pre><code>ERROR in [at-loader] ./another.ts:1:3
      TS1005: ';' expected.
  
  ERROR in [at-loader] ./another.ts:1:6
      TS1005: ';' expected.
  
  ERROR in [at-loader] ./another.ts:1:33
      TS1002: Unterminated string literal.
  
  ERROR in [at-loader] ./another.ts:1:1
      TS2304: Cannot find name 'I'.
  
  ERROR in [at-loader] ./another.ts:1:3
      TS2304: Cannot find name 'don'.
  </code></pre>
  
  <p>Full demo :</p>
  
  <pre><code>$ cat /etc/centos-release
  CentOS Linux release 7.3.1611 (Core)
  $ sudo yum install epel-release
  $ sudo yum install nodejs
  $ node -v
  v6.10.3
  $ npm init
  $ npm install --save-dev typescript ts-loader webpack
  $ node_modules/typescript/bin/tsc -v
  Version 2.3.4
  $ node_modules/typescript/bin/tsc --init
  $ vim index.ts
  </code></pre>
  
  <p><code>index.ts</code> :</p>
  
  <pre><code>class Person {
      public name: string;
  
      constructor(name:string) {
          this.name = name;
      }
  }
  
  let p:Person = new Person("Joe");
  console.log(p.name);
  </code></pre>
  
  <p>Transpilation works :</p>
  
  <pre><code>$ node_modules/typescript/bin/tsc index.ts
  </code></pre>
  
  <p>Execution works :</p>
  
  <pre><code>$ node index.js
  Joe
  </code></pre>
  
  <p><strong>Webpack</strong> configuration :</p>
  
  <pre><code>$ node_modules/webpack/bin/webpack.js -v
  3.0.0
  $ vim webpack.config.js
  </code></pre>
  
  <p><code>webpack.config.js</code> :</p>
  
  <pre><code>module.exports = {
    entry: './index.ts',
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          loader: 'ts-loader',
          exclude: /node_modules/,
        }
      ]
    },
    output: {
      filename: 'bundle.js',
      path: __dirname
    }
  };
  </code></pre>
  
  <p>Transpilation works :</p>
  
  <pre><code>$ node_modules/webpack/bin/webpack.js
  </code></pre>
  
  <p>Execution works :</p>
  
  <pre><code>$ node bundle.js
  Joe
  </code></pre>
  
  <p>Another file creation :</p>
  
  <pre><code>$ vim another.ts
  </code></pre>
  
  <p><code>another.ts</code> :</p>
  
  <pre><code>I don't want to check this file.
  </code></pre>
  
  <p>Re-transpilation :</p>
  
  <pre><code>$ node_modules/webpack/bin/webpack.js
  </code></pre>
  
  <p><strong>ERRORS !</strong></p>
  
  <pre><code>ERROR in [at-loader] ./another.ts:1:3
      TS1005: ';' expected.
  
  ERROR in [at-loader] ./another.ts:1:6
      TS1005: ';' expected.
  
  ERROR in [at-loader] ./another.ts:1:33
      TS1002: Unterminated string literal.
  
  ERROR in [at-loader] ./another.ts:1:1
      TS2304: Cannot find name 'I'.
  
  ERROR in [at-loader] ./another.ts:1:3
      TS2304: Cannot find name 'don'.
  </code></pre>
  
  <p><code>another.ts</code> is checked while it's not in <code>webpack.config.js</code> ! Why !</p>
  
  <p>I tried with <code>awesome-typescript-loader</code> instead of <code>ts-loader</code>, same problem.</p>