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: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,8 @@ Usually, Node.js caches all the `require` calls by default. In order to invalida
40
40
$ NODE_ENV=development node server.js
41
41
```
42
42
43
+
Still you can use [`devMode`](#devmode-boolean) option to override behavior which is imposed by environment variable.
44
+
43
45
### Basic example
44
46
45
47
Basically to attach the require hook you need to require this module. If you need to adjust it see the tuning section below.
@@ -150,6 +152,16 @@ hook({
150
152
});
151
153
```
152
154
155
+
### `devMode` boolean
156
+
157
+
Helps you to invalidate cache of all `require` calls. Usually used for the development purpose. Also overrides behavior, imposed by `NODE_ENV` environment variable. For example:
158
+
159
+
```bash
160
+
hook({
161
+
devMode: false,
162
+
});
163
+
```
164
+
153
165
### `extensions` array
154
166
155
167
Attach the require hook to additional file extensions (for example `['.scss']`).
0 commit comments