From a82b25c4ee4a560ee72292898bc6017f3de05ed7 Mon Sep 17 00:00:00 2001 From: patak Date: Mon, 17 May 2021 16:10:44 +0200 Subject: [PATCH] fix: warn about dynamic import polyfill only during build (#3446) --- packages/vite/src/node/plugins/dynamicImportPolyfill.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/plugins/dynamicImportPolyfill.ts b/packages/vite/src/node/plugins/dynamicImportPolyfill.ts index 9c6fdfa7a85e2b..e5f941f0e60bd6 100644 --- a/packages/vite/src/node/plugins/dynamicImportPolyfill.ts +++ b/packages/vite/src/node/plugins/dynamicImportPolyfill.ts @@ -31,7 +31,7 @@ export function dynamicImportPolyfillPlugin(config: ResolvedConfig): Plugin { }, load(id) { if (id === polyfillId) { - if (!enabled) { + if (!enabled && config.command === 'build') { config.logger.warnOnce( `\n'vite/dynamic-import-polyfill' is no longer needed if you target modern browsers` )