Skip to content

Commit

Permalink
fix(plugin-legacy): chunk may not exist (vitejs#3886)
Browse files Browse the repository at this point in the history
  • Loading branch information
y1d7ng authored and aleclarson committed Nov 8, 2021
1 parent b0bbd54 commit ceba4c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/plugin-legacy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ function viteLegacyPlugin(options = {}) {
},

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

0 comments on commit ceba4c3

Please sign in to comment.