Closed jeremytenjo closed 2 years ago
Because Next.js support for ES Modules is light, and does not support advanced usecases like importing CSS from node_modules
, advanced monorepos setup, or applying your babel transformations to the packages you import from node_modules
(a few random examples).
If you just plan on using ES Modules from npm
, Next.js built-in support should serve you well :)
Thanks @martpie for the reason, makes sense👍
For people interested, the Nextjs team has an open RFC to fix this issue.
I believe global css import has been solved a while ago from the Next.js team 🤔
From what I see in the comment, this doesn't include transpiling them via Babel though.
Nextjs 12 supposedly supports ES Modules, why does it still fail when building a Nextjs app with NPM packages that are ES modules?