英文:
Have a shared library for assets in nx and next 13
问题
我想在我的nx monorepo中为资产创建一个共享库,我们在两个项目中都使用了next.js。
我阅读了文档,您可以使用以下方式:
"assets": [
{
"input": "libs/my-lib/public",
"glob": "**/*",
"output": "./.."
}
],
但出于某种原因,它不起作用。当我像这样导入图像时,它会显示404错误。不确定这是否也是正确的方式。
英文:
I want to have a shared library for assets in my nx monorepo we are both using next js in both projects.
I read the docs that you can use:
"assets": [
{
"input": "libs/my-lib/public",
"glob": "**/*",
"output": "./.."
}
],
But for some reason it just doesn't work. It states a 404 for my images when I import them like this. Not sure if this is also the way to go though.
答案1
得分: 0
在 project.json 中添加这行代码后,只需运行 npm run build,nx 就会立即复制并粘贴您的图片。
英文:
It seems if you add this in project.json you just need to do an npm run build and nx would copy and paste your images immediately.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论