title: Webpack Karma + Typescript with ES6
body: <p>I am trying to run a karma test for a library written in typescript, but keep getting <code>Uncaught SyntaxError: Unexpected token import</code>even though babel is imported and configured for <code>es2015</code>. (Unfortunately, karma will only support ES6 starting at v2.5)</p>
  
  <p>What do I need change in the configuration to make things work?</p>
  
  <p><strong>karma.conf.js:</strong></p>
  
  <pre><code>var webpackConfig = require('./webpack.config.test');
  
  module.exports = function(config) {
      config.set({
          basePath: '',
          frameworks: ['jasmine'],
          files: [
              {
                  pattern: './config/karma.tests.js',
                  watched: false
              }
          ],
          preprocessors: {
              './config/karma.tests.js': ['babel', 'webpack', 'sourcemap']
          },
          plugins: [
              'karma-webpack',
              'karma-jasmine',
              'karma-sourcemap-loader',
              'karma-chrome-launcher',
              'karma-phantomjs-launcher',
              'karma-babel-preprocessor'
          ],
          babelPreprocessor: {
              options: {
                  presets: ['es2015']
              }
          },
          webpack: webpackConfig,
          webpackMiddleware: {
              stats: 'errors-only'
          },
          webpackServer: {
              noInfo: true
          },
          reporters: ['progress'],
          port: 9876,
          colors: true,
          logLevel: config.LOG_INFO,
          autoWatch: false,
          browsers: ['PhantomJS'],
          singleRun: true
      });
  };
  </code></pre>
  
  <p><strong>webpack.config.test.js</strong></p>
  
  <pre><code>var webpack                         = require('webpack');
  var helpers                         = require('./helpers');
  
  var config = {
      devtool: 'inline-source-map',
      resolve: {
          root: helpers.root('src'),
          extensions: [ '', '.js', '.ts' ]
      },
      module: {
          loaders: [
              {
                  test: /\.ts$/,
                  loader: 'ts-loader',
                  include: helpers.root('src'),
                  exclude: helpers.root('node_modules')
              }
          ]
      },
  }
  
  module.exports = config;
  </code></pre>
  
  <p><strong>tsconfig.json:</strong></p>
  
  <pre><code>{
      "compileOnSave": false,
      "compilerOptions": {
          "declaration": true,
          "declarationDir": "declarations",
          "module": "commonjs",
          "moduleResolution": "node",
          "noImplicitAny": true,
          "outDir": "dist",
          "preserveConstEnums": true,
          "removeComments": false,
          "sourceMap": true,
          "experimentalDecorators": true,
          "emitDecoratorMetadata": true,        
          "target": "es6",
          "typeRoots": [
              "node_modules/@types"
          ]
      },
      "exclude": [
          "node_modules",
          "dist"
      ]
  }
  </code></pre>