Skip to content

Commit

Permalink
fix(plugin-legacy): fix type errors (#4762)
Browse files Browse the repository at this point in the history
  • Loading branch information
llc1123 committed Sep 18, 2021
1 parent 1bd6d56 commit 5491143
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/plugin-legacy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function viteLegacyPlugin(options = {}) {
/**
* @param {string | ((chunkInfo: import('rollup').PreRenderedChunk) => string)} fileNames
* @param {string?} defaultFileName
* @returns {(chunkInfo: import('rollup').PreRenderedChunk) => string)}
* @returns {string | ((chunkInfo: import('rollup').PreRenderedChunk) => string)}
*/
const getLegacyOutputFileName = (
fileNames,
Expand Down Expand Up @@ -559,7 +559,9 @@ async function buildPolyfillChunk(
}
}
})
const polyfillChunk = (Array.isArray(res) ? res[0] : res).output[0]
const _polyfillChunk = Array.isArray(res) ? res[0] : res
if (!('output' in _polyfillChunk)) return
const polyfillChunk = _polyfillChunk.output[0]

// associate the polyfill chunk to every entry chunk so that we can retrieve
// the polyfill filename in index html transform
Expand Down

0 comments on commit 5491143

Please sign in to comment.