Skip to content

Commit

Permalink
fix(babel): default polyfills need es6.array.iterator for IE (#1769)
Browse files Browse the repository at this point in the history
close #1642
  • Loading branch information
LinusBorg authored and Akryum committed Jul 5, 2018
1 parent 701d02a commit bda6dea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ test('polyfill detection', () => {
}))
// default includes
expect(code).toMatch(`import "core-js/modules/es6.promise"`)
// promise polyfill alone doesn't work in IE, needs this as well. fix: #1642
expect(code).toMatch(`import "core-js/modules/es6.array.iterator"`)
// usage-based detection
expect(code).toMatch(`import "core-js/modules/es6.map"`)
})
Expand Down
5 changes: 4 additions & 1 deletion packages/@vue/babel-preset-app/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const path = require('path')

const defaultPolyfills = [
'es6.promise'
'es6.promise',
// promise polyfill alone doesn't work in IE,
// needs this as well. see: #1642
'es6.array.iterator'
]

function getPolyfills (targets, includes, { ignoreBrowserslistConfig, configPath }) {
Expand Down

0 comments on commit bda6dea

Please sign in to comment.