Ale*_*tti 5 dependencies amd commonjs angular
我已经从 angular 7.1.4 更新到了 10。现在我收到了这样的奇怪警告:
C:\Sviluppo\Welcome\welcome-cloud-app\src\app\calendario-fasce\mese\mese.component.ts 中的警告取决于 src/app/interfaces/calendar/calendar.component。CommonJS 或 AMD 依赖项可能会导致优化救助。有关更多信息,请参阅:https : //angular.io/guide/build#configuring-commonjs-dependencies
对于像这样的其他警告,我在 angular.json 中添加了相关行,例如:
"allowedCommonJsDependencies": [
"moment",
....
]"
Run Code Online (Sandbox Code Playgroud)
如何解决与我的组件相关的此警告?
删除 TS 别名可能会起作用。
import { x } from '@auth/auth....' // Warning
...to...
import { x } from '../auth/...' // Warning goes away
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请参阅此链接