Skip to content

Commit 8dcfc18

Browse files
yyx990803haoqunjiang
authored andcommittedJan 11, 2019
feat(babel): include es6.object.assign by default (#3281)
This ensures support for Object rest spread usage in templates with vue-template-es2015-compiler@1.8.0
1 parent 1553757 commit 8dcfc18

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎packages/@vue/babel-preset-app/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ See [@babel/preset-env docs](https://new.babeljs.io/docs/en/next/babel-preset-en
8080

8181
### polyfills
8282

83-
- Default: `['es6.array.iterator', 'es6.promise', 'es7.promise.finally']`
83+
- Default: `['es6.array.iterator', 'es6.promise', 'es6.object.assign', 'es7.promise.finally']`
8484

8585
A list of [core-js](https://github.com/zloirock/core-js) polyfills to pre-include when using `useBuiltIns: 'usage'`. **These polyfills are automatically excluded if they are not needed for your target environments**.
8686

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

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ const defaultPolyfills = [
66
'es6.array.iterator',
77
// this is required for webpack code splitting, vuex etc.
88
'es6.promise',
9+
// this is needed for object rest spread support in templates
10+
// as vue-template-es2015-compiler 1.8+ compiles it to Object.assign() calls.
11+
'es6.object.assign',
912
// #2012 es6.promise replaces native Promise in FF and causes missing finally
1013
'es7.promise.finally'
1114
]

0 commit comments

Comments
 (0)
Please sign in to comment.