From c256d8798cbaaab4adf7fd9adc4cfb9343f7351f Mon Sep 17 00:00:00 2001 From: Terry Date: Wed, 29 Aug 2018 13:03:42 +0800 Subject: [PATCH] fix(karma-webpack): allow `filename` and `chunkFilename` to be overridden (`config.output`) (#336) --- src/karma-webpack.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/karma-webpack.js b/src/karma-webpack.js index bf98ce71..20cc3323 100644 --- a/src/karma-webpack.js +++ b/src/karma-webpack.js @@ -62,11 +62,15 @@ function Plugin( // https://github.com/webpack/webpack/issues/645 webpackOptions.output.path = path.join(os.tmpdir(), '_karma_webpack_', indexPath, '/') webpackOptions.output.publicPath = path.join(os.tmpdir(), '_karma_webpack_', publicPath, '/') - webpackOptions.output.filename = '[name]' if (includeIndex) { webpackOptions.output.jsonpFunction = `webpackJsonp${index}` } - webpackOptions.output.chunkFilename = '[id].bundle.js' + if (!webpackOptions.output.filename) { + webpackOptions.output.filename = '[name].js' + } + if (!webpackOptions.output.chunkFilename) { + webpackOptions.output.chunkFilename = '[id].bundle.js' + } }) this.emitter = emitter