Can';t解决';tslib&x27;在[路径]中。。。对于位于angular app文件夹之外的typescript模型
对于angular 6应用程序,我使用位于angular project文件夹之外的模型,因为有些模型存储在asp.net核心解决方案中,我会自动将C#类转换为typescript类。我在angular应用程序中通过导出/导入桶引用这些类型脚本模型 例如,我的angular应用程序的根文件夹是:Can';t解决';tslib&x27;在[路径]中。。。对于位于angular app文件夹之外的typescript模型,angular,Angular,对于angular 6应用程序,我使用位于angular project文件夹之外的模型,因为有些模型存储在asp.net核心解决方案中,我会自动将C#类转换为typescript类。我在angular应用程序中通过导出/导入桶引用这些类型脚本模型 例如,我的angular应用程序的根文件夹是: C:\Angular_Projects\ng-wfm-sky 示例性typescript模型的路径为: C:/VS_Projects/WorkforceMonitorSky/Wfm.Api.Outer
C:\Angular_Projects\ng-wfm-sky
示例性typescript模型的路径为:
C:/VS_Projects/WorkforceMonitorSky/Wfm.Api.OuterFacingModels/Post/WorkorderOfmPost.ts
使用相对路径通过typesscript桶导出/导入
在开发模式下一切正常,angular应用程序使用“ng serve”运行时没有问题
但我在使用“ng build--prod”构建应用程序时遇到错误:
到目前为止,我所尝试的:
- 使用“npm安装--保存tslib”将tslib显式安装到angular项目中
ERROR in C:/VS_Projects/WorkforceMonitorSky/Wfm.Api.OuterFacingModels/Post/WorkorderOfmPost.ts
Module not found: Error: Can't resolve 'tslib' in 'C:\VS_Projects\WorkforceMonitorSky\Wfm.Api.OuterFacingModels\Post'