-
-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathbabel.config.js
More file actions
28 lines (27 loc) · 772 Bytes
/
babel.config.js
File metadata and controls
28 lines (27 loc) · 772 Bytes
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
// @ts-check
// We aim to have the same support as Next.js
// https://nextjs.org/docs/getting-started#system-requirements
// https://nextjs.org/docs/basic-features/supported-browsers-features
/** @type {import("@babel/core").ConfigFunction} */
module.exports = (api) => {
const isTest = api.env("test")
if (isTest) {
return {
presets: [
"@babel/preset-env",
["@babel/preset-react", { runtime: "automatic" }],
["@babel/preset-typescript", { isTSX: true, allExtensions: true }],
],
}
}
return {
presets: [
["@babel/preset-env", { targets: { node: 18 } }],
"@babel/preset-typescript",
],
ignore: [
"**/__tests__/**",
],
comments: false
}
}