Skip to content

Commit 024a2de

Browse files
fix(plugin-legacy): bake-in Promise polyfill, fix #4414 (#4440)
1 parent 6d919cf commit 024a2de

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/plugin-legacy/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ function viteLegacyPlugin(options = {}) {
4444
const facadeToLegacyPolyfillMap = new Map()
4545
const facadeToModernPolyfillMap = new Map()
4646
const modernPolyfills = new Set()
47-
const legacyPolyfills = new Set()
47+
// System JS relies on the Promise interface. It needs to be polyfilled for IE 11. (array.iterator is mandatory for supporting Promise.all)
48+
const DEFAULT_LEGACY_POLYFILL = [
49+
'core-js/modules/es.promise',
50+
'core-js/modules/es.array.iterator'
51+
]
52+
const legacyPolyfills = new Set(DEFAULT_LEGACY_POLYFILL)
4853

4954
if (Array.isArray(options.modernPolyfills)) {
5055
options.modernPolyfills.forEach((i) => {

0 commit comments

Comments
 (0)