From 60e1bbba47c2ea84d02e0cd41dcd985159f542e0 Mon Sep 17 00:00:00 2001 From: dragonHandsome <61896951+dragonHandsome@users.noreply.github.com> Date: Mon, 11 Oct 2021 21:17:44 +0800 Subject: [PATCH] fix(plugin-legacy): fail to get the fileName fileName could not be obtained in the bundle argument of the writeBundle hook, see: https://rollupjs.org/guide/en/#writebundle --- packages/plugin-legacy/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-legacy/index.js b/packages/plugin-legacy/index.js index bfa6ee491bcbf6..50462a5e5ad524 100644 --- a/packages/plugin-legacy/index.js +++ b/packages/plugin-legacy/index.js @@ -593,7 +593,7 @@ async function buildPolyfillChunk( } // add the chunk to the bundle - bundle[polyfillChunk.name] = polyfillChunk + bundle[polyfillChunk.fileName] = polyfillChunk } const polyfillId = 'vite/legacy-polyfills'