-
Notifications
You must be signed in to change notification settings - Fork 3
/
babel.config.js
36 lines (34 loc) · 1.02 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
/* eslint-disable unicorn/prefer-module */
// This is solely used to support i18next-extract
// do not put anything in here that is not related to i18next-extract
const common = ["@babel/env"];
module.exports = {
presets: [
"@babel/preset-env",
"@babel/preset-typescript",
"@babel/preset-react",
],
plugins: [
[
"i18next-extract",
{
nsSeparator: null,
keySeparator: false,
keyAsDefaultValue: ["en"],
useI18nextDefaultValue: true,
keyAsDefaultValueForDerivedKeys: true,
},
],
["@babel/plugin-syntax-import-attributes"],
],
overrides: [
{ test: /\.js$/, presets: common },
{ test: /\.jsx$/, presets: [...common, "@babel/react"] },
{ test: /\.ts$/, presets: [...common, "@babel/typescript"] },
{
test: /\.tsx$/,
presets: [...common, "@babel/typescript", "@babel/react"],
},
],
};
// override to behave like tsc and use right plugins for each extension - https://github.com/babel/babel/issues/6959#issuecomment-356769843