MCPcopy
hub / github.com/webpack/webpack / recordSideEffectsBailout

Function recordSideEffectsBailout

lib/NormalModule.js:145–158  ·  view source on GitHub ↗
(mod, moduleGraph, dep)

Source from the content-addressed store, hash-verified

143 * @param {Dependency} dep the dep that triggered the bailout
144 */
145const 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

Callers 3

walkSideEffectsIterativeFunction · 0.85
propagateLinearResultFunction · 0.85
walkSideEffectsRecursiveFunction · 0.85

Calls 5

formatLocationFunction · 0.85
hasMethod · 0.45
addMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected