forked from SalesforceCommerceCloud/commerce-sdk-isomorphic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
33 lines (31 loc) · 816 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
31
32
33
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
/* eslint-disable @typescript-eslint/no-var-requires */
const jest = require('./babel.config.jest');
const pkg = require('./package.json');
module.exports = api => {
const isTest = api.env('test');
if (isTest) {
return jest;
}
return {
plugins: ['@babel/plugin-proposal-class-properties'],
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 3,
modules: false,
targets: pkg.browserslist.production,
},
],
'@babel/typescript',
'@babel/preset-react',
],
};
};