You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/configuration/output.md
+23-1
Original file line number
Diff line number
Diff line change
@@ -538,12 +538,34 @@ There is no need to change it.
538
538
539
539
`boolean`
540
540
541
-
Tell webpack to remove a module from cache if it throws an exception when it is `require`d.
541
+
Tell webpack to remove a module from the module instance cache (`require.cache`) if it throws an exception when it is `require`d.
542
542
543
543
It defaults to `false` for performance reasons.
544
544
545
545
When set to `false`, the module is not removed from cache, which results in the exception getting thrown only on the first `require` call (making it incompatible with node.js).
546
546
547
+
For instance, consider `module.js`:
548
+
549
+
```js
550
+
thrownewError("error");
551
+
```
552
+
553
+
With `strictModuleExceptionHandling` set to `false`, only the first `require` throws an exception:
554
+
555
+
```js
556
+
// with strictModuleExceptionHandling = false
557
+
require("module") // <- throws
558
+
require("module") // <- doesn't throw
559
+
```
560
+
561
+
Instead, with `strictModuleExceptionHandling` set to `true`, all `require`s of this module throw an exception:
0 commit comments