首页 > 解决方案 > 解决针对 CommonJS 或 AMD 依赖项的警告

问题描述

我在终端中收到以下警告。我该如何解决这个问题?(删除警告)

Warning: C:\Users\Sharon\Documents\MyProject\PROJECTOne\node_modules\@azure\core-tracing\dist-esm\src\interfaces.js depends on '@opentelemetry/api'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

标签: angularjsangularazureblobazure-blob-storage

解决方案


您可以删除 CommonJS 或 AMD 依赖项可能会导致优化救助.....通过在 angular.json 的构建部分中添加以下代码片段

"allowedCommonJsDependencies": [
      "opentelemetry",

   ]

如果不起作用,请回复我


推荐阅读