Skip to content

Commit bbfccba

Browse files
committed
fix: warn on non-existent polyfill names instead of throwing error
Fixes vuejs#3578
1 parent 0809fc8 commit bbfccba

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/@vue/babel-preset-app/index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,14 @@ function getPolyfills (targets, includes) {
8181
}
8282

8383
const compatData = require('core-js-compat').data
84-
return includes.filter(item => isRequired(item, targets, { compatData }))
84+
return includes.filter(item => {
85+
if (!compatData[item]) {
86+
console.warn(`Skipping polyfill ${item} as it's not found in the compatibility table.`)
87+
return false
88+
}
89+
90+
return isRequired(item, targets, { compatData })
91+
})
8592
}
8693

8794
module.exports = (context, options = {}) => {

0 commit comments

Comments
 (0)