From 1d231ee3fe419f588b0d9bbaf34e2546c916865b Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Sat, 14 Sep 2024 18:59:59 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E2=9A=A1=EF=B8=8F=20use=20default=20re?= =?UTF-8?q?solver=20(#56)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vite/src/node/plugins/index.ts | 28 +++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/packages/vite/src/node/plugins/index.ts b/packages/vite/src/node/plugins/index.ts index 351827adc6c714..731f78f4237984 100644 --- a/packages/vite/src/node/plugins/index.ts +++ b/packages/vite/src/node/plugins/index.ts @@ -82,19 +82,21 @@ export async function resolvePlugins( }) : modulePreloadPolyfillPlugin(config) : null, - resolvePlugin( - { - root: config.root, - isProduction: config.isProduction, - isBuild, - packageCache: config.packageCache, - asSrc: true, - fsUtils: getFsUtils(config), - optimizeDeps: true, - externalize: isBuild && !!config.build.ssr, // TODO: should we do this for all environments? - }, - config.environments, - ), + enableNativePlugin + ? null + : resolvePlugin( + { + root: config.root, + isProduction: config.isProduction, + isBuild, + packageCache: config.packageCache, + asSrc: true, + fsUtils: getFsUtils(config), + optimizeDeps: true, + externalize: isBuild && !!config.build.ssr, // TODO: should we do this for all environments? + }, + config.environments, + ), htmlInlineProxyPlugin(config), cssPlugin(config), config.esbuild !== false