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
The following examples demonstrate a few ways this plugin can be used.
23
+
## Using filter functions
24
+
25
+
-`checkContext(context)` A Filter function that receives context as the argument, must return boolean.
26
+
-`checkResource(resource)` A Filter function that receives resource as the argument, must return boolean.
20
27
28
+
```javascript
29
+
newwebpack.IgnorePlugin({
30
+
checkContext (context) {
31
+
// do something with context
32
+
returntrue|false;
33
+
},
34
+
checkResource (resource) {
35
+
// do something with resource
36
+
returntrue|false;
37
+
}
38
+
});
39
+
```
21
40
22
-
## Ignore Moment Locales
41
+
## Example of ignoring Moment Locales
23
42
24
43
As of [moment](https://momentjs.com/) 2.18, all locales are bundled together with the core library (see [this GitHub issue](https://github.com/moment/moment/issues/2373)).
25
44
@@ -37,8 +56,11 @@ require('./locale/' + name);
37
56
38
57
...your first regexp must match that `'./locale/'` string. The second `contextRegExp` parameter is then used to select specific directories from where the import took place. The following will cause those locale files to be ignored:
0 commit comments