title: webpack 2 ts loader doesn't exclude spec file
body: <p>I'm trying to build my own angular2/webpack2 boilerplate
  this is my set up </p>
  
  <h2>webpack.common.js</h2>
  
  <pre><code>const webpack = require('webpack');
  const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
  const ExtractTextPlugin = require('extract-text-webpack-plugin');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  
  const helpers = require('./helpers');
  
  const METADATA = {
    title: 'Angular2 Webpack2 Starter by Whisher',
    baseUrl: '/',
    isDevServer: helpers.isWebpackDevServer()
  };
  module.exports = {
    devtool: 'cheap-module-source-map',
    entry: {
      'polyfills': './src/polyfills.ts',
      'vendor':    './src/vendor.ts',
      'main':      './src/main.ts'
    },
    resolve: {
      extensions: ['.ts', '.js', '.json']
    },
    module: {
      rules: [
        {
          test: /\.ts$/,
          loaders: [
            '@angularclass/hmr-loader',
            'awesome-typescript-loader',
            'angular2-template-loader',
            'angular-router-loader'
          ],
          exclude: [/\.(spec|e2e)\.ts$/]
        },
        {
          test: /\.html$/,
          loaders: ['html-loader']
        },
        {
          test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
          loader: 'file-loader?name=assets/[name].[hash].[ext]'
        },
        {
          test: /\.css$/,
          loader: ExtractTextPlugin.extract({
            fallbackLoader: 'style-loader',
            loader: 'css-loader?sourceMap'
          }),
          exclude: helpers.root('src', 'app'),
        },
        {
          test: /\.css$/,
          include: helpers.root('src', 'app'),
          loader: 'raw-loader'
        }
      ]
    },
    plugins: [
      new CommonsChunkPlugin({
        name: ['app', 'vendor', 'polyfills']
      }),
      new ExtractTextPlugin({ filename: 'bundle.css', disable: false, allChunks: true }),
      new HtmlWebpackPlugin({
        template: 'src/index.html',
        title: METADATA.title,
        metadata: METADATA,
        inject: 'body',
        hash: true
      }),
    ]
  };
  </code></pre>
  
  <h2>webpack.dev.js</h2>
  
  <pre><code>const webpackMerge = require('webpack-merge');
  const ExtractTextPlugin = require('extract-text-webpack-plugin');
  
  const commonConfig = require('./webpack.common.js');
  
  const helpers = require('./helpers');
  
  module.exports = webpackMerge(commonConfig, {
    devtool: 'cheap-module-source-map',
  
    output: {
      path: helpers.root('dist'),
      filename: '[name].bundle.js',
      sourceMapFilename: '[name].map',
      chunkFilename: '[id].chunk.js'
    },
  
    plugins: [
      new ExtractTextPlugin('[name].css')
    ],
  
    devServer: {
      historyApiFallback: true,
      stats: 'minimal'
    }
  });
  </code></pre>
  
  <p>The script works fine but I've not the spec excluded
  when I run </p>
  
  <p><strong>npm start</strong></p>
  
  <p>I've got</p>
  
  <pre><code>    WARNING in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
  69:15-36 Critical dependency: the request of a dependency is an expression
  
  WARNING in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
  85:15-102 Critical dependency: the request of a dependency is an expression
  
  ERROR in [at-loader] src/app/app.component.spec.ts:6:1 
      Cannot find name 'describe'.
  
  ERROR in [at-loader] src/app/app.component.spec.ts:7:3 
      Cannot find name 'beforeEach'.
  
  ERROR in [at-loader] src/app/app.component.spec.ts:15:3 
      Cannot find name 'it'.
  
  ERROR in [at-loader] src/app/app.component.spec.ts:17:6 
      Cannot find name 'expect'.
  
  ERROR in [at-loader] src/app/app.component.spec.ts:20:3 
      Cannot find name 'it'.
  
  ERROR in [at-loader] src/app/app.component.spec.ts:24:5 
      Cannot find name 'expect'.
  </code></pre>
  
  <p>What's the problem ? </p>
  
  <p>Thanks in advance</p>
  
  <h2>REPO</h2>
  
  <p>just in case 
  <a href="https://bitbucket.org/whisher/angular2-webpack2-starter" rel="noreferrer">https://bitbucket.org/whisher/angular2-webpack2-starter</a></p>
  
  <h2>Worked out</h2>
  
  <p>In my tsconfig.json</p>
  
  <pre><code>"exclude": [
      "node_modules",
      "dist",
      "**/*.spec.ts"
    ],
  </code></pre>