问题
I've updated from angular 7.1.4 to 10. Now i receive strange warnings like this one:
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
For other warnings like this, i've added in angular.json the relative line, for example:
"allowedCommonJsDependencies": [
"moment",
....
]"
How can i resolve this warning relative to my components?
回答1:
Removing TS alias might work.
import { x } from '@auth/auth....' // Warning
...to...
import { x } from '../auth/...' // Warning goes away
Refer this link for more
来源:https://stackoverflow.com/questions/62593028/angular-10-commonjs-or-amd-dependencies-can-cause-optimization-bailouts