From 46ff8251d07b8e5d57ca834333924ba61423d3e4 Mon Sep 17 00:00:00 2001 From: linl33 Date: Fri, 5 May 2023 10:49:44 +0800 Subject: [PATCH] fix(build): declare moduleSideEffects for vite:modulepreload-polyfill --- packages/vite/src/node/plugins/modulePreloadPolyfill.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/plugins/modulePreloadPolyfill.ts b/packages/vite/src/node/plugins/modulePreloadPolyfill.ts index 0f1ef11cf26f5e..ede79c8b882f77 100644 --- a/packages/vite/src/node/plugins/modulePreloadPolyfill.ts +++ b/packages/vite/src/node/plugins/modulePreloadPolyfill.ts @@ -25,7 +25,7 @@ export function modulePreloadPolyfillPlugin(config: ResolvedConfig): Plugin { if (!polyfillString) { polyfillString = `${isModernFlag}&&(${polyfill.toString()}());` } - return polyfillString + return { code: polyfillString, moduleSideEffects: true } } }, }