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: src/content/configuration/other-options.mdx
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -444,7 +444,23 @@ Make sure to wrap the path in a capture group if you use regular expressions.
444
444
445
445
An array of paths that are managed by a package manager and can be trusted to not be modified otherwise.
446
446
447
-
Make sure to wrap the path in a capture group if you use regular expressions.
447
+
Make sure you wrap the path in a capture group if you are using regular expressions so webpack can extract the path, for example, here's a RegExp webpack internally uses to match the `node_modules` directory:
448
+
449
+
```text
450
+
/^(.+?[\\/]node_modules)[\\/]/
451
+
```
452
+
453
+
A common use case for `managedPaths` would be to exclude some folders from `node_modules`, e.g. you want webpack to know that files in the `node_modules/@azure/msal-browser` folder are expected to change, which can be done with a regular expression like the one below:
0 commit comments