Skip to content

Commit 255a105

Browse files
committed
added information about devMode
1 parent 11c509b commit 255a105

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Usually, Node.js caches all the `require` calls by default. In order to invalida
4040
$ NODE_ENV=development node server.js
4141
```
4242

43+
Still you can use [`devMode`](#devmode-boolean) option to override behavior which is imposed by environment variable.
44+
4345
### Basic example
4446

4547
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({
150152
});
151153
```
152154

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+
153165
### `extensions` array
154166

155167
Attach the require hook to additional file extensions (for example `['.scss']`).

0 commit comments

Comments
 (0)