(mod, moduleGraph, dep)
| 143 | * @param {Dependency} dep the dep that triggered the bailout |
| 144 | */ |
| 145 | const recordSideEffectsBailout = (mod, moduleGraph, dep) => { |
| 146 | if (mod._addedSideEffectsBailout === undefined) { |
| 147 | mod._addedSideEffectsBailout = new WeakSet(); |
| 148 | } else if (mod._addedSideEffectsBailout.has(moduleGraph)) { |
| 149 | return; |
| 150 | } |
| 151 | mod._addedSideEffectsBailout.add(moduleGraph); |
| 152 | moduleGraph |
| 153 | .getOptimizationBailout(mod) |
| 154 | .push( |
| 155 | () => |
| 156 | `Dependency (${dep.type}) with side effects at ${formatLocation(dep.loc)}` |
| 157 | ); |
| 158 | }; |
| 159 | |
| 160 | // Maximum recursive descent depth before switching to the iterative walker. |
| 161 | // #20986 reported overflow around 1300 modules in webpack 5.107.0 where each |
no test coverage detected