gpt4 book ai didi

Angular 10 - CommonJS 或 AMD 依赖可能导致优化救助

转载 作者:行者123 更新时间:2023-12-03 21:52:13 25 4
gpt4 key购买 nike

我已经从 angular 7.1.4 更新到了 10。
现在我收到这样的奇怪警告:

WARNING in C:\Sviluppo\Welcome\welcome-cloud-app\src\app\calendario-fasce\mese\mese.component.ts depends on src/app/interfaces/calendar/calendar.component. CommonJS or AMD dependencies can cause optimization bailouts.For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies


对于像这样的其他警告,我在 angular.json 中添加了相关行,例如:
"allowedCommonJsDependencies": [
"moment",
....
]"
如何解决与我的组件相关的此警告?

最佳答案

删除 TS 别名可能会起作用。

import { x } from '@auth/auth....'           // Warning
...to...
import { x } from '../auth/...' // Warning goes away
有关更多信息,请参阅此 link

关于Angular 10 - CommonJS 或 AMD 依赖可能导致优化救助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62593028/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com