From 29aa2fbf1d4191d980c45f6989a0d2f807c69fe9 Mon Sep 17 00:00:00 2001 From: Young Liang Date: Sun, 17 Mar 2024 16:52:20 +0800 Subject: [PATCH] docs: update readme --- packages/node-resolve/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/node-resolve/README.md b/packages/node-resolve/README.md index 40425d2d7..6866a6853 100755 --- a/packages/node-resolve/README.md +++ b/packages/node-resolve/README.md @@ -133,11 +133,19 @@ Specifies the properties to scan within a `package.json`, used to determine the ### `preferBuiltins` -Type: `Boolean`
+Type: `Boolean | (module: string) => boolean`
Default: `true` (with warnings if a builtin module is used over a local version. Set to `true` to disable warning.) If `true`, the plugin will prefer built-in modules (e.g. `fs`, `path`). If `false`, the plugin will look for locally installed modules of the same name. +Alternatively, you may pass in a function that returns a boolean to confirm whether the plugin should prefer built-in modules. e.g. + +```js +preferBuiltins: (module) => module !== 'punycode'; +``` + +will not treat `punycode` as a built-in module + ### `modulesOnly` Type: `Boolean`