From 47e5e726a003cd1f17a7dd6c32d284786462016d Mon Sep 17 00:00:00 2001 From: Daniel Tschinder <231804+danez@users.noreply.github.com> Date: Thu, 13 Jul 2023 17:14:42 +0200 Subject: [PATCH 1/2] docs: Clarify external option --- docs/config/index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/config/index.md b/docs/config/index.md index 30e83dacbc33..5413c3149e1d 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -133,10 +133,13 @@ You will not be able to edit your `node_modules` code for debugging, since the c #### deps.external - **Type:** `(string | RegExp)[]` -- **Default:** `['**/node_modules/**']` +- **Default:** `[/\/node_modules\//]` Externalize means that Vite will bypass the package to native Node. Externalized dependencies will not be applied Vite's transformers and resolvers, so they do not support HMR on reload. Typically, packages under `node_modules` are externalized. +When using strings they need to be paths inside your [`deps.moduleDirectories`](/config/#deps.moduleDirectories). For example `external: ['module/folder']` with the default `moduleDirectories` option will externalize `node_modules/module/folder`. +Regular expressions on the other hand are matched against the whole path. + #### deps.inline - **Type:** `(string | RegExp)[] | true` From d839e2f620a051182fee1b3c00f595fefec4ef4e Mon Sep 17 00:00:00 2001 From: Daniel Tschinder <231804+danez@users.noreply.github.com> Date: Thu, 13 Jul 2023 17:18:59 +0200 Subject: [PATCH 2/2] fix link --- docs/config/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config/index.md b/docs/config/index.md index 5413c3149e1d..d1cea17e35b4 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -137,7 +137,7 @@ You will not be able to edit your `node_modules` code for debugging, since the c Externalize means that Vite will bypass the package to native Node. Externalized dependencies will not be applied Vite's transformers and resolvers, so they do not support HMR on reload. Typically, packages under `node_modules` are externalized. -When using strings they need to be paths inside your [`deps.moduleDirectories`](/config/#deps.moduleDirectories). For example `external: ['module/folder']` with the default `moduleDirectories` option will externalize `node_modules/module/folder`. +When using strings they need to be paths inside your [`deps.moduleDirectories`](/config/#deps-moduledirectories). For example `external: ['module/folder']` with the default `moduleDirectories` option will externalize `node_modules/module/folder`. Regular expressions on the other hand are matched against the whole path. #### deps.inline