Skip to content

Commit

Permalink
fix(plugin-legacy): bake-in Promise polyfill, fix #4414 (#4440)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreBonaventure committed Jul 29, 2021
1 parent 6d919cf commit 024a2de
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 024a2de

Please sign in to comment.