Skip to content

Commit

Permalink
fix: warn on non-existent polyfill names instead of throwing error
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Jun 2, 2020
1 parent 0809fc8 commit bbfccba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/@vue/babel-preset-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ function getPolyfills (targets, includes) {
}

const compatData = require('core-js-compat').data
return includes.filter(item => isRequired(item, targets, { compatData }))
return includes.filter(item => {
if (!compatData[item]) {
console.warn(`Skipping polyfill ${item} as it's not found in the compatibility table.`)
return false
}

return isRequired(item, targets, { compatData })
})
}

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

0 comments on commit bbfccba

Please sign in to comment.