From 4b6a9bdef4c1ca287d8a93649d6f5b3e1289aeed Mon Sep 17 00:00:00 2001 From: Chaejun Lee Date: Thu, 20 Jul 2023 14:12:44 +0900 Subject: [PATCH] docs(config): add information about `build.warnExternalChunkRender` --- docs/config/build-options.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/config/build-options.md b/docs/config/build-options.md index b5872e363de973..b063deb5029aec 100644 --- a/docs/config/build-options.md +++ b/docs/config/build-options.md @@ -250,4 +250,13 @@ Set to `{}` to enable rollup watcher. This is mostly used in cases that involve There are cases that file system watching does not work with WSL2. See [`server.watch`](./server-options.md#server-watch) for more details. +## build.warnExternalChunkRender + +- **Type:** `boolean` +- **Default:** `false` + +Vite, by default, tries to split dynamic imports into separate chunks. However, when a dynamic import is both statically and dynamically imported in the same module, it can't be split into a separate chunk. This is called an Ineffective Dynamic Import, and Vite issues a warning about it. + +This warning can be informative for an app's own module, but it can also be noisy when used with third-party libraries. Therefore, Vite skips the warning of ineffective dynamic imports produced by modules that exist in `node_modules`. Setting this option to true will enable the warning for all ineffective dynamic imports. + :::