From d4306564482f1663c3328594ad879b264818bf74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Fri, 23 Feb 2018 14:02:37 +0100 Subject: [PATCH] explicitly mention to use ./ in require() for local files, closes #1774 --- readme.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/readme.markdown b/readme.markdown index 7c97a847b..b3118771f 100644 --- a/readme.markdown +++ b/readme.markdown @@ -510,7 +510,9 @@ If `file` is an array, each item in `file` will be added as an entry file. Make `file` available from outside the bundle with `require(file)`. -The `file` param is anything that can be resolved by `require.resolve()`. +The `file` param is anything that can be resolved by `require.resolve()`, +including files from `node_modules`. Like with `require.resolve()`, you must +prefix `file` with `./` to require a local file (not in `node_modules`). `file` can also be a stream, but you should also use `opts.basedir` so that relative requires will be resolvable.