File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
packages/plugin-legacy/src Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
63
63
const facadeToLegacyPolyfillMap = new Map ( )
64
64
const facadeToModernPolyfillMap = new Map ( )
65
65
const modernPolyfills = new Set < string > ( )
66
- // System JS relies on the Promise interface. It needs to be polyfilled for IE 11. (array.iterator is mandatory for supporting Promise.all)
67
- const DEFAULT_LEGACY_POLYFILL = [
68
- 'core-js/modules/es.promise' ,
69
- 'core-js/modules/es.array.iterator'
70
- ]
71
- const legacyPolyfills = new Set ( DEFAULT_LEGACY_POLYFILL )
66
+ const legacyPolyfills = new Set < string > ( )
72
67
73
68
if ( Array . isArray ( options . modernPolyfills ) ) {
74
69
options . modernPolyfills . forEach ( ( i ) => {
@@ -150,11 +145,13 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
150
145
151
146
// legacy bundle
152
147
if ( legacyPolyfills . size || genDynamicFallback ) {
153
- if ( ! legacyPolyfills . has ( 'es.promise' ) ) {
154
- // check if the target needs Promise polyfill because SystemJS relies
155
- // on it
156
- await detectPolyfills ( `Promise.resolve()` , targets , legacyPolyfills )
157
- }
148
+ // check if the target needs Promise polyfill because SystemJS relies on it
149
+ // https://github.com/systemjs/systemjs#ie11-support
150
+ await detectPolyfills (
151
+ `Promise.resolve(); Promise.all();` ,
152
+ targets ,
153
+ legacyPolyfills
154
+ )
158
155
159
156
isDebug &&
160
157
console . log (
You can’t perform that action at this time.
0 commit comments