Skip to content

Commit

Permalink
fix(controller): disallow custom optiomization (#578)
Browse files Browse the repository at this point in the history
this will often break the inner workings of karma-webpack
due to a number of issues coming in about this in particular
it has been decided that it is best to ignore these kinds
of customizations and log a warning that they are discarded

Fixes #491
  • Loading branch information
codymikol authored Oct 22, 2023
1 parent 908e03c commit f2327b1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/karma-webpack/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ defaulting ${newOptions.output.filename} to [name].js.`.trim()
delete newOptions.output.filename;
}

if (newOptions.optimization) {
console.warn(
'karma-webpack does not support custom optimization configurations for webpack, the optimizations passed will be ignored.'
);
delete newOptions.optimization;
}

this.webpackOptions = merge(this.webpackOptions, newOptions);
}

Expand Down

0 comments on commit f2327b1

Please sign in to comment.