From 06709554d6f95e3e9a341cbd8576c4db56158149 Mon Sep 17 00:00:00 2001 From: Cody Mikol Date: Sat, 21 Oct 2023 16:44:20 -0400 Subject: [PATCH] fix(controller): don't warn if name is default (#559) This prevents a warning that occurs when output.filename is set to '[name].js'. Because this is the default, there is no need to warn the user as no change will happen. Fixes #550 --- lib/karma-webpack/controller.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/karma-webpack/controller.js b/lib/karma-webpack/controller.js index 7843800..c1b1f19 100644 --- a/lib/karma-webpack/controller.js +++ b/lib/karma-webpack/controller.js @@ -22,12 +22,14 @@ class KW_Controller { updateWebpackOptions(newOptions) { if (newOptions.output && newOptions.output.filename) { - console.warn( - ` + if (newOptions.output.filename !== '[name].js') { + console.warn( + ` karma-webpack does not currently support customized filenames via webpack output.filename, if this is something you need consider opening an issue. defaulting ${newOptions.output.filename} to [name].js.`.trim() - ); + ); + } delete newOptions.output.filename; }