Skip to content

Commit

Permalink
fix(v4): fix modern mode optional chaining syntax tranpilation (#6459)
Browse files Browse the repository at this point in the history
closes #6449
  • Loading branch information
haoqunjiang authored May 7, 2021
1 parent b39726e commit 9a125a2
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 @@ -50,7 +50,14 @@ function getModernTargets (targets) {
)

// use the intersection of modern mode browsers and user defined targets config
return getIntersectionTargets(targets, allModernTargets)
const result = getIntersectionTargets(targets, allModernTargets)

// webpack 4 uses acorn 6, which does not support newer syntaxes such as optional chaining
// so we have to add samsung 12 as a target to force transpiling these syntaxes
// https://github.com/vuejs/vue-cli/issues/6449#issuecomment-828559068
result.samsung = '12.0.0'

return result
}

function getWCTargets (targets) {
Expand Down

0 comments on commit 9a125a2

Please sign in to comment.