Skip to content

Commit 9a125a2

Browse files
authored
fix(v4): fix modern mode optional chaining syntax tranpilation (#6459)
closes #6449
1 parent b39726e commit 9a125a2

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
@@ -50,7 +50,14 @@ function getModernTargets (targets) {
5050
)
5151

5252
// use the intersection of modern mode browsers and user defined targets config
53-
return getIntersectionTargets(targets, allModernTargets)
53+
const result = getIntersectionTargets(targets, allModernTargets)
54+
55+
// webpack 4 uses acorn 6, which does not support newer syntaxes such as optional chaining
56+
// so we have to add samsung 12 as a target to force transpiling these syntaxes
57+
// https://github.com/vuejs/vue-cli/issues/6449#issuecomment-828559068
58+
result.samsung = '12.0.0'
59+
60+
return result
5461
}
5562

5663
function getWCTargets (targets) {

0 commit comments

Comments
 (0)