-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
22 lines (21 loc) · 817 Bytes
/
babel.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// babelrc doesn't respect NODE_PATH anymore but using require does.
// Alternative to install them locally in node_modules
module.exports = function (api) {
// ensure env is test so that this config won't impact build or dev server
if (api.env("test")) {
return {
presets: [require("@babel/preset-env"), require("@babel/preset-react"), require("@babel/preset-typescript")],
plugins: [
[require("@babel/plugin-transform-runtime"), { regenerator: true }],
require("@babel/plugin-proposal-class-properties"),
require("@babel/plugin-proposal-object-rest-spread"),
[require("@babel/plugin-transform-modules-commonjs"), { allowTopLevelThis: true }],
],
};
}
return {};
};