英文:
NestJS compilerOptions assets wrong path
问题
我不太知道如何解释,但基本上我有.hbs文件,邮件资源需要这些文件。通常,当我运行npm start run:dev
时,这些文件不会被复制到dist
文件夹中。所以我修改了nest-cli.json
,像这样。
但现在我遇到的问题是它们被复制到的路径不正确。
这是我在根目录中的情况:
而这是它们被复制到的位置:
英文:
I don't really know hot to explain it but basically I have .hbs files which the mail resource needs. Normally they don't get copied into the dist
folder when I run npm start run:dev
. So I modified the nest-cli.json
like this.
But now I have the problem that the patch which they are getting copied to are not correct.
This is how I have it in my root folder:
And this is where it gets copied to:
I´ve tried playing around with the assets path and searched for answers but I didn't find any other way of coping those files
答案1
得分: 2
"compilerOptions": {
"assets": [
{
"include": "/mail",
"outDir": "dist/mail",
"watchAssets": true
},
],
"watchAssets": true
}
请注意,在您的第一张图片中,mail
文件夹下的 templates
文件夹与您的第二张图片中的 mail/templates
相同。这是因为您在父文件夹下只有一个文件夹。
英文:
"compilerOptions": {
"assets": [
{
"include": "/mail",
"outDir": "dist/mail",
"watchAssets": true
},
],
"watchAssets": true
}
note that in your first image templates
folder under mail
folder is same as mail/templates
in your second image. And this because you have only one folder under the parent folder
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论