Skip to content

Commit dd5931d

Browse files
authored
fix(plugin-legacy): chunk may not exist (#3886)
1 parent de1ddd4 commit dd5931d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/plugin-legacy/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ function viteLegacyPlugin(options = {}) {
303303
},
304304

305305
transformIndexHtml(html, { chunk }) {
306+
if (!chunk) return
306307
if (chunk.fileName.includes('-legacy')) {
307308
// The legacy bundle is built first, and its index.html isn't actually
308309
// emitted. Here we simply record its corresponding legacy chunk.

0 commit comments

Comments
 (0)