-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
32 lines (32 loc) · 1 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
module.exports = (api) => {
const isTest = api.env("test");
return {
presets: [
"@babel/preset-react", // optional: react: this resolves react-files (jsx, tsx)
"@babel/preset-typescript", // allows to use TypeScript
[
"@babel/preset-env", // allows you to use the latest JavaScript
isTest
? {
targets: {
node: "current",
},
}
: {},
],
],
plugins: [
"@babel/plugin-proposal-class-properties", // transforms static class properties as well as properties declared with the property initializer syntax
"@babel/plugin-proposal-private-methods",
"jsx-classnames-advanced", // optional: react: this resolves className={object}
[
"prismjs",
{
languages: ["css", "javascript", "html"], // example: https://hackernoon.com/using-prismjs-as-a-syntax-highlighter-in-react
theme: "default",
css: true,
},
],
],
};
};