From 8a5515ada1f96e94db06d9a9b8802140a9784063 Mon Sep 17 00:00:00 2001 From: nshen Date: Fri, 24 Dec 2021 11:37:05 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20exclude=20cesium=20pr?= =?UTF-8?q?e-bundling=20when=20dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.ts b/src/index.ts index 46ed47e..b8dc7d8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,6 +47,11 @@ function vitePluginCesium( CESIUM_BASE_URL: JSON.stringify(CESIUM_BASE_URL) } }; + if (!isBuild) { + userConfig.optimizeDeps = { + exclude: ['cesium'] + }; + } if (isBuild && !rebuildCesium) { userConfig.build!.rollupOptions = { external: ['cesium'],