diff --git a/karma.conf.js b/karma.conf.js index 6a58357f2..853fb9b69 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,6 +1,7 @@ // Karma configuration file var karma = require("karma"); -var DEFAULT_NG_VERSION = "1.5"; +var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); +var DEFAULT_NG_VERSION = "1.6"; /** * This returns a Karma 'files configuration'. @@ -30,8 +31,28 @@ function karmaServedFiles(ngVersion) { return angularFiles.concat('test/index.js'); } -var webpackConfig = require('./webpack.config.js'); -webpackConfig.devtool = 'inline-source-map'; +var webpackConfig = module.exports = { + resolve: { + modules: ['node_modules'], + extensions: ['.js', '.jsx', '.ts', '.tsx'] + }, + + devtool: 'inline-source-map', + + module: { + rules: [ + { test: /\.tsx?$/, loader: 'ts-loader', options: { transpileOnly: true } } + ] + }, + + stats: false, + + plugins: [ + new ForkTsCheckerWebpackPlugin(), + ], + + externals: [ 'angular' ] +}; module.exports = function(config) { var ngVersion = config.ngversion || DEFAULT_NG_VERSION; diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index b3343fba2..000000000 --- a/webpack.config.js +++ /dev/null @@ -1,27 +0,0 @@ -const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); - -module.exports = { - entry: { - 'angular-ui-router': './src/index.ts', - 'stateEvents': './src/legacy/stateEvents.ts', - }, - - resolve: { - modules: ['node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'] - }, - - module: { - rules: [ - { test: /\.tsx?$/, loader: 'ts-loader', options: { transpileOnly: true } } - ] - }, - - stats: false, - - plugins: [ - new ForkTsCheckerWebpackPlugin(), - ], - - externals: [ 'angular' ] -};