由于将我们的项目更新到 nx 工作区 8,库“ng g lib mylib”的生成不允许仅创建纯打字稿库。
以前的问题:“这个库应该使用什么框架?” 允许选择“TypeScript”以避免为库创建特定于 UI 的配置。
由于在版本 8 中更改(https://nx.dev/guides/nx7-to-nx8)到原理图,我正在寻找工作区的正确配置,以避免创建和维护自定义原理图。
预先感谢您的建议。
手动删除了配置文件中的相应条目:
删除 tsconfiglib.json 中的节点 ->
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
},
Run Code Online (Sandbox Code Playgroud)
删除 jest.config.js 中的节点 ->
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js'
]
Run Code Online (Sandbox Code Playgroud)
将 angular.js 中的“schematics”从“@nrwl/angular:component”更改为“@nrwl/schematics:component”