-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbabel.config.js
52 lines (51 loc) · 1.22 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
48
49
50
51
52
const productionPlugins = ['@babel/plugin-transform-react-constant-elements']
module.exports = {
presets: [
[
'next/babel',
{
// Target ES2015+ browsers
'preset-env': {
targets: 'Chrome >= 60, Safari >= 10.1, iOS >= 10.3, Firefox >= 54, Edge >= 15',
useBuiltIns: false,
},
},
],
],
plugins: [
[
'@emotion',
{
// Allows an emotion component to be used as a CSS selector.
// https://github.com/mui/material-ui/issues/26366#issuecomment-942435579
importMap: {
'@mui/material': {
styled: {
canonicalImport: ['@emotion/styled', 'default'],
styledBaseImport: ['@mui/material', 'styled'],
},
},
'@mui/material/styles': {
styled: {
canonicalImport: ['@emotion/styled', 'default'],
styledBaseImport: ['@mui/material/styles', 'styled'],
},
},
},
},
],
'babel-plugin-optimize-clsx',
[
'babel-plugin-i18n-tag-translate',
{
groupDir: './src',
},
],
],
env: {
development: {},
production: {
plugins: productionPlugins,
},
},
}