perf(dev): speed up dev server

Avoid compiling the entire of mui library by using babel.
This commit is contained in:
rusconn
2022-03-25 10:03:49 +00:00
parent b02c9d6169
commit 55fd4a6473
15 changed files with 114 additions and 83 deletions

View File

@@ -1,4 +1,5 @@
// https://emotion.sh/docs/css-prop##babel-preset
// https://mui.com/guides/minimizing-bundle-size/#option-2
{
"presets": [
[
@@ -11,5 +12,25 @@
}
]
],
"plugins": [["@emotion/babel-plugin"]]
"plugins": [
[
"babel-plugin-import",
{
"libraryName": "@mui/material",
"libraryDirectory": "",
"camel2DashComponentName": false
},
"core"
],
[
"babel-plugin-import",
{
"libraryName": "@mui/icons-material",
"libraryDirectory": "",
"camel2DashComponentName": false
},
"icons"
],
["@emotion/babel-plugin"]
]
}