我有一个简单的 Ember 应用程序,我需要填充Object.fromEntries
一个组件。
作为参考,我使用原生支持的 Safari 12.1.1fromEntries
和不支持的 Safari 11.1.1。
AFAIK,我只需要一个适当的ember-cli-build.js
配置。
如果有人能告诉我为什么以下调整不能正确地填充函数,我将不胜感激:
const app = new EmberApp(defaults, {
'ember-cli-babel': {
// supposedly should inject core-js/stable into app
// @see https://github.com/babel/ember-cli-babel#polyfill
includePolyfill: true,
},
babel: {
// should replace injected core-js/stable with imports
// that are not natively supported by config/targets.js
// @see https://babeljs.io/docs/en/babel-preset-env#usebuiltins-entry
useBuiltIns: 'entry',
// explicitly use corejs v3 per babel-preset-env docs
corejs: 3,
// force inclusion of fromEntries regardless of config/targets.js
include: [
'es.object.from-entries',
],
},
//...
});
软件包版本:
- ember-source@3.7.2
- ember-cli@3.5.0
- ember-cli-babel@7.5.0
- @babel/core@7.5.5
- 核心js@3.2.1