|
|
|
|
|
by theogravity
485 days ago
|
|
Next.js doesn't play well with barrel packages (large packages that export everything into the main entrypoint file). It's a known issue (but rarely mentioned when you read about working with Next.js): https://github.com/vercel/next.js/issues/48748 I've never used MUI, but assuming that MUI is a barrel package, and you do the following: import { Component } from "mui";
Next.js ends up compiling the entire package instead of just that component you need. If MUI has their components exported into separate files, an optimization would be: import { Component } from "mui/path/to/component";
|
|