Angular 由于相对路径,Nx工作区中的角度生产构建失败
当我为nx工作区(v11.x)中的一个angular(v11.x)库触发生产构建时,我得到以下错误:Angular 由于相对路径,Nx工作区中的角度生产构建失败,angular,build,production,nrwl-nx,Angular,Build,Production,Nrwl Nx,当我为nx工作区(v11.x)中的一个angular(v11.x)库触发生产构建时,我得到以下错误: nx run i18n-components:build:production Building Angular Package ------------------------------------------------------------------------------ Building entry point '@smallstack/i18n-components' --
nx run i18n-components:build:production
Building Angular Package
------------------------------------------------------------------------------
Building entry point '@smallstack/i18n-components'
------------------------------------------------------------------------------
√ Compiling TypeScript sources through NGC
× Bundling to FESM2015
ERROR: Could not resolve '../../../../../../dist/libs/axios-api-client/src/index' from dist\libs\components\i18n-components\esm2015\lib\stores\locale.store.js
Could not resolve '../../../../../../dist/libs/axios-api-client/src/index' from dist\libs\components\i18n-components\esm2015\lib\stores\locale.store.js
———————————————————————————————————————————————
> NX ERROR Running target "build" failed
查看
locale.store.js
中的输出,它似乎没有通过tsconfig->path使用包名,而是尝试通过相对路径查找文件。我解决了问题。。。如果您有一个@Injectable({providedIn:“root”})
的服务,或者@Injectable({providedIn:“platform”})
需要一个不需要的服务,那么您会得到该错误
我想,根服务应该只依赖于其他根服务吗