-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.cjs
35 lines (33 loc) · 999 Bytes
/
babel.config.cjs
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
// 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: ":",
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