diff --git a/packages/plugin-legacy/src/index.ts b/packages/plugin-legacy/src/index.ts index 5fedb716f04f86..d107a2d66ac619 100644 --- a/packages/plugin-legacy/src/index.ts +++ b/packages/plugin-legacy/src/index.ts @@ -591,7 +591,7 @@ async function buildPolyfillChunk( } // add the chunk to the bundle - bundle[polyfillChunk.name] = polyfillChunk + bundle[polyfillChunk.fileName] = polyfillChunk } const polyfillId = '\0vite/legacy-polyfills'