-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
babel.config.js
39 lines (37 loc) · 915 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
34
35
36
37
38
39
/**
* Babel configuration
*
* @see https://babeljs.io/docs/en/options
* @copyright 2016-present Kriasoft (https://git.io/vMINh)
*
* @param {import("@babel/core").ConfigAPI} api
* @returns {import("@babel/core").TransformOptions}
*/
module.exports = function config(api) {
return {
presets: ["@babel/preset-env"],
plugins: [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
],
ignore: api.env("test") ? [] : ["**/__tests__/**", "**/*.test.ts"],
sourceMaps: api.env("production"),
overrides: [
{
test: /\.ts$/,
presets: [
[
"@babel/preset-typescript",
{
targets: { node: 12 },
},
],
],
},
{
test: "**/*.d.ts",
presets: [["@babel/preset-env", { targets: { esmodules: true } }]],
},
],
};
};