[英]How to import css files from react library inside libs to next.js app in nx integrated monorepo?
Can anyone help out on assets configuration in a nx next.js project.任何人都可以帮助 nx next.js 项目中的资产配置。 I have multiple libs and one next.js project.我有多个库和一个 next.js 项目。 I have got two problems我有两个问题
For the first question, it seems that next 13.0.3 causes the imported global.css from node_modules to fail due to global css conflict constraint.对于第一个问题,next 13.0.3 似乎导致从 node_modules 导入的 global.css 由于全局 css 冲突约束而失败。 From what I found, it only happen when the import statement is in the lib.根据我的发现,只有当 import 语句在 lib 中时才会发生。 If imported directly in the nextjs pages, the build is successful.如果直接在nextjs页面导入,则构建成功。
Temporarily Fix:临时修复:
https://github.com/vercel/next.js/releases/tag/v13.0.3 #42615 https://github.com/vercel/next.js/releases/tag/v13.0.3 #42615
It seems that (not sure) this is the culprit that cause NX lib to import global css to fail in nextjs.似乎(不确定)这是导致NX lib导入全局css在nextjs中失败的罪魁祸首。 https://github.com/vercel/next.js/pull/42615 https://github.com/vercel/next.js/pull/42615
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.