Skip to content

Commit

Permalink
fix(plugin-legacy): bake-in Promise polyfill, fix vitejs#4414 (vitejs…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreBonaventure authored and aleclarson committed Nov 8, 2021
1 parent c502bcf commit 3a51d6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/plugin-legacy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ function viteLegacyPlugin(options = {}) {
const facadeToLegacyPolyfillMap = new Map()
const facadeToModernPolyfillMap = new Map()
const modernPolyfills = new Set()
const legacyPolyfills = new Set()
// System JS relies on the Promise interface. It needs to be polyfilled for IE 11. (array.iterator is mandatory for supporting Promise.all)
const DEFAULT_LEGACY_POLYFILL = [
'core-js/modules/es.promise',
'core-js/modules/es.array.iterator'
]
const legacyPolyfills = new Set(DEFAULT_LEGACY_POLYFILL)

if (Array.isArray(options.modernPolyfills)) {
options.modernPolyfills.forEach((i) => {
Expand Down

0 comments on commit 3a51d6c

Please sign in to comment.