From b524c652ccbded1ef25863d533841d492b17bc97 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder <231804+danez@users.noreply.github.com> Date: Fri, 28 Jul 2023 10:54:25 +0200 Subject: [PATCH] docs: clarify external option (#3769) --- 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..d1cea17e35b4 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`