Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs with edge case for building Staging environment with npm #5640

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: better error message for non-existent polyfill names (#5543)
Fixes #3578
  • Loading branch information
haoqunjiang authored Jun 24, 2020
commit cc38420e392f08b63d2b53aa03095bfa1f9a5b72
8 changes: 7 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,13 @@ 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]) {
throw new Error(`Cannot find polyfill ${item}, please refer to 'core-js-compat' for a complete list of available modules`)
}

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

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