简体   繁体   English

NestJS compilerOptions assets 路径错误

[英]NestJS compilerOptions assets wrong path

I don't really know hot to explain it but basically I have.hbs files which the mail resource needs.我真的不知道如何解释它,但基本上我有邮件资源需要的 .hbs 文件。 Normally they don't get copied into the dist folder when I run npm start run:dev .通常,当我运行npm start run:dev时,它们不会被复制到dist文件夹中。 So I modified the nest-cli.json like this.所以我这样修改了nest-cli.json

在此处输入图像描述

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我试过使用资产路径并搜索答案,但我没有找到任何其他方式来处理这些文件

"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.请注意,在mail文件夹下的第一个图像templates文件夹中,与第二个图像中的mail/templates相同。 And this because you have only one folder under the parent folder这是因为您在父文件夹下只有一个文件夹

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM