From 3e09b170ae8a6d6b6a794e82b06881b938dcebcd Mon Sep 17 00:00:00 2001 From: Oren Me Date: Wed, 8 Nov 2017 15:56:13 +0200 Subject: [PATCH] chore: use one webpack.config for test and build (#159) use one webpack.config.js for both dev|build|test - saves boilerplate code and a change will be propagated to all places --- karma.conf.js | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index deeceaab9..a32f4ca53 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,3 +1,7 @@ +let webpackConfig = require('./webpack.config.js'); +//Need to remove externals otherwise they won't be included in test +delete webpackConfig.externals; + const isWindows = /^win/.test(process.platform); const isMacOS = /^darwin/.test(process.platform); // Create custom launcher in case running with Travis @@ -54,26 +58,7 @@ module.exports = function (config) { 'progress', 'coverage' ], - webpack: { - devtool: 'inline-source-map', - module: { - rules: [{ - test: /\.js$/, - use: [{ - loader: "babel-loader" - }], - exclude: [ - /node_modules/ - ] - }, { - test: /\.css$/, - use: [ - {loader: "style-loader"}, - {loader: "css-loader"} - ] - }] - } - }, + webpack: webpackConfig, webpackServer: { noInfo: true },