From 4216f1357d6ae3552762b3cf8e2d652b1286f6b9 Mon Sep 17 00:00:00 2001 From: Joshua Wiens Date: Wed, 15 Mar 2017 00:15:56 -0500 Subject: [PATCH] fix: don't swallow configuration errors (#232) * fix: don't swallow configuration errors * style: fix semi lint issues --- src/karma-webpack.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/karma-webpack.js b/src/karma-webpack.js index 758189e..3e3cb03 100644 --- a/src/karma-webpack.js +++ b/src/karma-webpack.js @@ -62,7 +62,17 @@ function Plugin( this.basePath = basePath this.waiting = [] - var compiler = webpack(webpackOptions) + var compiler + try { + compiler = webpack(webpackOptions) + } catch (e) { + console.error(e.stack || e) + if (e.details) { + console.error(e.details) + } + throw e + } + var applyPlugins = compiler.compilers || [compiler] applyPlugins.forEach(function(compiler) {