Skip to content

Commit

Permalink
Merge pull request #15624 from webpack/add-warning-when-cache-unaffec…
Browse files Browse the repository at this point in the history
…ted-and-concat-modules

throw error when using module concatenation and cacheUnaffected
  • Loading branch information
sokra committed Apr 5, 2022
2 parents c38caa2 + 99a5793 commit cb639b3
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 cb639b3

Please sign in to comment.