2018-05-29 05:06:30 +02:00
|
|
|
/*
|
2021-01-20 02:52:56 +01:00
|
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
2021-02-04 03:12:39 +01:00
|
|
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
|
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
|
|
* Side Public License, v 1.
|
2018-05-29 05:06:30 +02:00
|
|
|
*/
|
|
|
|
|
2019-10-14 17:36:10 +02:00
|
|
|
const plugins = [
|
|
|
|
require.resolve('babel-plugin-add-module-exports'),
|
|
|
|
|
|
|
|
// The class properties proposal was merged with the private fields proposal
|
|
|
|
// into the "class fields" proposal. Babel doesn't support this combined
|
|
|
|
// proposal yet, which includes private field, so this transform is
|
|
|
|
// TECHNICALLY stage 2, but for all intents and purposes it's stage 3
|
|
|
|
//
|
|
|
|
// See https://github.com/babel/proposals/issues/12 for progress
|
|
|
|
require.resolve('@babel/plugin-proposal-class-properties'),
|
2019-11-15 18:29:25 +01:00
|
|
|
|
2020-12-01 15:55:54 +01:00
|
|
|
// Optional Chaining proposal is stage 4 (https://github.com/tc39/proposal-optional-chaining)
|
2019-11-15 18:29:25 +01:00
|
|
|
// Need this since we are using TypeScript 3.7+
|
|
|
|
require.resolve('@babel/plugin-proposal-optional-chaining'),
|
2020-12-01 15:55:54 +01:00
|
|
|
|
|
|
|
// Nullish coalescing proposal is stage 4 (https://github.com/tc39/proposal-nullish-coalescing)
|
2019-11-15 18:29:25 +01:00
|
|
|
// Need this since we are using TypeScript 3.7+
|
|
|
|
require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'),
|
2020-06-11 10:04:09 +02:00
|
|
|
|
2020-12-01 15:55:54 +01:00
|
|
|
// Proposal is on stage 4, and included in ECMA-262 (https://github.com/tc39/proposal-export-ns-from)
|
2020-06-11 10:04:09 +02:00
|
|
|
// Need this since we are using TypeScript 3.8+
|
|
|
|
require.resolve('@babel/plugin-proposal-export-namespace-from'),
|
|
|
|
|
2020-12-01 15:55:54 +01:00
|
|
|
// Proposal is on stage 4, and included in ECMA-262 (https://github.com/tc39/proposal-export-ns-from)
|
2020-06-11 10:04:09 +02:00
|
|
|
// Need this since we are using TypeScript 3.9+
|
|
|
|
require.resolve('@babel/plugin-proposal-private-methods'),
|
2019-10-14 17:36:10 +02:00
|
|
|
];
|
|
|
|
|
2017-09-20 02:44:47 +02:00
|
|
|
module.exports = {
|
2019-12-16 19:28:54 +01:00
|
|
|
presets: [
|
|
|
|
[require.resolve('@babel/preset-typescript'), { allowNamespaces: true }],
|
|
|
|
require.resolve('@babel/preset-react'),
|
2019-04-22 22:37:07 +02:00
|
|
|
],
|
2019-12-16 19:28:54 +01:00
|
|
|
plugins,
|
2017-09-20 02:44:47 +02:00
|
|
|
};
|