Disable TypeScript mismatch in ng-packagr

二次信任 提交于 2019-12-11 17:18:43

问题


In an Angular CLI project, when using an unsupported version of TypeScript you may get the following warning:

@angular/compiler-cli@6.1.0 requires typescript@'>=X.X.X <Y.Y.Y' but Z.Z.Z was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.

It is possible to disable the TypeScript mismatch warning for the default project with the following command:

ng config cli.warnings.typescriptMismatch false

Now, when building an Angular library, ng-packagr throws this warning as an error, even with the typescriptMismatch setting set to false. Is it possible to temporarily disable this error? It is understood that this should not be done in a production environment, but it may be helpful when debugging issues that may be caused by TypeScript. The following StackOverflow question serves as an example use case.


回答1:


You need to use disableTypeScriptVersionCheck under angularCompilerOptions In your tsconfig.



来源:https://stackoverflow.com/questions/51861942/disable-typescript-mismatch-in-ng-packagr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!