【问题标题】:Angular Compiler looking for html files in NX buildable libraryAngular 编译器在 NX 可构建库中查找 html 文件
【发布时间】:2021-08-15 18:15:10
【问题描述】:

我是 NX 新手,创建了一个库“designsystem-angular-header”,它依赖于另一个库“designsystem-angular”

当我尝试构建编译器时,会转到 dist 文件夹来搜索依赖项的 html 文件吗?只有没有,只有打字稿文件……有人有这方面的经验吗?

我有一个开箱即用的 Angular 12 tsconfig 设置,除了

"angularCompilerOptions": {
    "enableIvy": false
  }

简而言之,错误是说它找不到 html 文件,我发现它首先在寻找那些文件有点奇怪......

nx run designsystem-angular-header:build:production 

Building entry point '@husbanken/designsystem-angular-header'

 Compiling TypeScript sources through NGC
ERROR: Cannot read file C:\Users\hoko\IdeaProjects\hb-nx-frontend\husbanken\dist\libs\designsystem-angular\lib\accordion\accordion.component.html.
...

我的版本是: "@angular/cli": "12.0.0", "@nrwl/cli": "12.3.3", 节点:12.14.1 npm: 6.12.0

【问题讨论】:

  • 你在 nx.json 中定义了@husbanken 吗?
  • @robbieAreBest,感谢您的回复:) 不,我有“npmScope”:“husbanken”,...尝试将其更改为“@husbanken”,但没有用...我应该有在别的地方吗?
  • 启用部分 Ivy 成功了 "angularCompilerOptions": { "compilationMode": "partial" }¨,但仍然不明白为什么它在 dist 中搜索 htmls :)

标签: angular typescript build nomachine-nx


【解决方案1】:

反正你不会在 dist 上找到 html 文件,就是这样

【讨论】:

    猜你喜欢
    • 2021-05-22
    • 1970-01-01
    • 2019-05-21
    • 2021-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-30
    相关资源
    最近更新 更多