-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
executable file
·46 lines (43 loc) · 1.09 KB
/
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
40
41
42
43
44
45
46
/* SPDX-FileCopyrightText: 2014-present Kriasoft <hello@kriasoft.com> */
/* SPDX-License-Identifier: MIT */
/**
* Babel configuration.
*
* @see https://babeljs.io/docs/en/options
* @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",
],
overrides: [
{
test: /\.tsx?$/,
presets: ["@babel/preset-typescript"],
},
{
test: /\.tsx$/,
presets: [
[
"@babel/preset-react",
{
development: api.env() === "development",
useBuiltIns: true,
runtime: "automatic",
importSource: "@emotion/react",
},
],
],
plugins: ["@emotion/babel-plugin"],
},
{
test: "**/*.d.ts",
presets: [["@babel/preset-env", { targets: { esmodules: true } }]],
},
],
};
};