Skip to content

Commit

Permalink
throw error when using module concatenation and cacheUnaffected
Browse files Browse the repository at this point in the history
optimization.concatenateModules can't be used with cacheUnaffected as module concatenation is a global effect
  • Loading branch information
vankop committed Apr 4, 2022
1 parent 05ebf5b commit 99a5793
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/optimize/ModuleConcatenationPlugin.js
Expand Up @@ -58,6 +58,11 @@ class ModuleConcatenationPlugin {
apply(compiler) {
const { _backCompat: backCompat } = compiler;
compiler.hooks.compilation.tap("ModuleConcatenationPlugin", compilation => {
if (compilation.moduleMemCaches) {
throw new Error(
"optimization.concatenateModules can't be used with cacheUnaffected as module concatenation is a global effect"
);
}
const moduleGraph = compilation.moduleGraph;
const bailoutReasonMap = new Map();

Expand Down

0 comments on commit 99a5793

Please sign in to comment.