-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
/
Copy pathbabel.config.js
30 lines (28 loc) · 926 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
23
24
25
26
27
28
29
30
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
module.exports = {
env: {
// USED FOR NODE/RUNTIME
// maybe we should differentiate both cases because
// we mostly need to transpile some features so that node does not crash...
lib: {
presets: [
['@babel/preset-env', {targets: {node: 14}, modules: 'commonjs'}],
['@babel/preset-typescript', {isTSX: true, allExtensions: true}],
],
},
// USED FOR JS SWIZZLE
// /lib-next folder is used as source to swizzle JS source code
// This JS code is created from TS source code
// This source code should look clean/human readable to be usable
'lib-next': {
presets: [
['@babel/preset-typescript', {isTSX: true, allExtensions: true}],
],
},
},
};