-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
47 lines (45 loc) · 1.74 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
47
// the filename must be babel.config.js to jest automatically pick this config file
// @see https://github.com/facebook/jest/issues/8365#issuecomment-713272521
module.exports = api => {
const isServer = api.caller(caller => !!caller && caller.isServer);
return {
presets: ['next/babel'],
plugins: [
'babel-plugin-macros',
['babel-plugin-styled-components', { ssr: false }],
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: false }],
// In contrast to MobX 4/5, "loose" must be false! ^
[
'babel-plugin-import',
{
libraryName: '@material-ui/core',
// Use "'libraryDirectory': ''," if your bundler does not support ES modules
libraryDirectory: '',
camel2DashComponentName: false,
},
'core',
],
[
'babel-plugin-import',
{
libraryName: '@material-ui/icons',
// Use "'libraryDirectory': ''," if your bundler does not support ES modules
libraryDirectory: '',
camel2DashComponentName: false,
},
'icons',
],
[
'babel-plugin-import',
{
libraryName: '@material-ui/styles',
// Use "'libraryDirectory': ''," if your bundler does not support ES modules
libraryDirectory: '',
camel2DashComponentName: false,
},
'styles',
],
],
};
};