forked from opensearch-project/dashboards-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbabel.config.js
More file actions
28 lines (26 loc) · 743 Bytes
/
Copy pathbabel.config.js
File metadata and controls
28 lines (26 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* 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
const pathAliasPlugin = require('@osd/babel-preset/path_alias');
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', {
useBuiltIns: false,
targets: {
node: 'current',
},
}),
require('@babel/preset-react'),
require('@babel/preset-typescript'),
],
plugins: [pathAliasPlugin({})],
};
}
return {};
};