NextJS 10 与 Material UI 编译速度太慢

ABC*_*ABC 3 javascript performance compilation reactjs next.js

我有一个包含许多组件的项目,但是如果我在保存文件和 NextJS 编译时处理独立的组件,则需要很长时间。我的开发时间受到这个问题的影响。

我运行 4 GB RAM,但速度仍然很慢

cross-env NODE_OPTIONS="--max_old_space_size=4096" next
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

可能出现哪些问题?

MUR*_*SRI 7

如果您使用导入组件

import {List,Grid,ListItem} from '@material-ui/core';

Run Code Online (Sandbox Code Playgroud)

相反尝试使用

import List from '@material-ui/core/List';
import Gridfrom '@material-ui/core/Grid';
import ListItem from '@material-ui/core/ListItem';
Run Code Online (Sandbox Code Playgroud)

这对我有用。