javascript - 带有 Material UI 的 NextJS 10 编译速度太慢
问题描述
我有一个包含许多组件的项目,但是如果我在保存文件和 NextJS 编译时处理隔离组件,则需要很长时间。我的开发时间受此问题影响。
我运行 4 GB 的 RAM,但它仍然很慢
cross-env NODE_OPTIONS="--max_old_space_size=4096" next
我该如何解决这个问题?
可能的问题是什么?
解决方案
如果您使用导入组件
import {List,Grid,ListItem} from '@material-ui/core';
而是尝试使用
import List from '@material-ui/core/List';
import Gridfrom '@material-ui/core/Grid';
import ListItem from '@material-ui/core/ListItem';
这对我有用。
推荐阅读
- javascript - div的CSS边框半径:首次加载时伪元素渲染错误
- mysql - 使用 Scala Slick 从 SQL 数据库中检索时间戳列中的日期在上个月或上周的所有记录
- montecarlo - 如何将 M/M/1 排队系统修改为 G/G/1?
- javascript - 使用 mongodb-memory-server 和 mongoose 创建内存数据库
- firebase - 添加目标后,Firebase 部署时出现 404 错误
- python - llvmlite 中的有符号/无符号 int 类型
- reactjs - ReactJS:处理多个复选框
- angular - 快速重复 HTTP 调用的 Angular/RXJS 数据问题
- django - 如何使用 django rest 框架正确保存和验证对象
- r - 使用列名列表从矩阵中删除列