我正在尝试将我的 Angular 9 应用程序升级到 Angular 10 版本,但在升级后低于警告
WARNING in calendar.reducer.ts depends on lodash/keys. CommonJS or AMD dependencies can cause optimization bailouts.
Run Code Online (Sandbox Code Playgroud)
我已将以下行添加到我的angular.json文件中,但问题未解决
"allowedCommonJsDependencies": ["lodash"]
Run Code Online (Sandbox Code Playgroud)
我该如何解决上述问题。
在 Angular 10 更新后,我收到了有关 Firebase 和 CommonJS 或 AMD 依赖项的这些警告!
WARNING in /Users/knewtone/yet/projects/WorkSpace/customers/smart-newtech-dashboard/src/app/app.component.ts depends on 'firebase'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
WARNING in /Users/knewtone/yet/projects/WorkSpace/customers/smart-newtech-dashboard/src/app/app.module.ts depends on '@angular/common/locales/fr'. When using the 'localize' option this import is not needed. Did you mean to import '@angular/common/locales/global/fr'? For more info see: https://angular.io/guide/i18n#import-global-variants-of-the-locale-data
WARNING in /Users/knewtone/yet/projects/WorkSpace/customers/smart-newtech-dashboard/src/app/services/crud/crud.service.ts depends on 'lodash/dropRight'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
WARNING in /Users/knewtone/yet/projects/WorkSpace/customers/smart-newtech-dashboard/node_modules/@angular/fire/__ivy_ngcc__/fesm2015/angular-fire.js depends on …Run Code Online (Sandbox Code Playgroud) 我有一个小 Angular 应用程序,我在其中使用PrimeNG components。由于我进行了 Angular 10 更新,我收到以下警告:
CommonJS 或 AMD 依赖项可能会导致优化救助。
对于不同的 PirmeNg 组件。
我已经试过了:
"allowedCommonJsDependencies": [
"loadsh",
"primeng/primeng",
"primeicons",
Run Code Online (Sandbox Code Playgroud)
这是官方主页上的建议
我做的另一个尝试是检查这篇文章中提到的导入
import { x } from '@auth/auth....' // Warning
...to...
import { x } from '../auth/...' // Warning goes away
Run Code Online (Sandbox Code Playgroud)
但是由于我在开始时没有任何带有“@”的导入,我想知道如何修复或抑制此警告?
编辑:
详细错误:
'path' 中的警告取决于 'chartjs'。CommonJS 或 AMD 依赖项可能会导致优化救助。
我们在 Angular 10 中收到此构建警告。如何修复?有没有像 Lodash-es 这样的替代 NPM ?
hotkeys.js 依赖于“捕鼠器”。CommonJs 和 AMD 依赖项可能导致优化救助