Skip to content

Commit e097441

Browse files
authored
chore(NA): use the same polyfill between the dev environment and the jest env (#57467) (#57483)
1 parent f69ff6d commit e097441

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

packages/kbn-babel-preset/node_preset.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ module.exports = (_, options = {}) => {
5454
// on their own
5555
useBuiltIns: 'entry',
5656
modules: 'cjs',
57-
corejs: 3,
57+
// right now when using `corejs: 3` babel does not use the latest available
58+
// core-js version due to a bug: https://github.com/babel/babel/issues/10816
59+
// Because of that we should use for that value the same version we install
60+
// in the package.json in order to have the same polyfills between the environment
61+
// and the tests
62+
corejs: '3.2.1',
5863

5964
...(options['@babel/preset-env'] || {}),
6065
},

packages/kbn-babel-preset/webpack_preset.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ module.exports = () => {
2525
{
2626
useBuiltIns: 'entry',
2727
modules: false,
28-
corejs: 3,
28+
// Please read the explanation for this
29+
// in node_preset.js
30+
corejs: '3.2.1',
2931
},
3032
],
3133
require('./common_preset'),

0 commit comments

Comments
 (0)