告警
CommonJS or AMD dependencies can cause optimization bailouts
解决
在angular.json中配置 allowedCommonJsDependencies
建议您避免在 Angular 应用程序中依赖 CommonJS 模块。依赖 CommonJS 模块可能会阻止打包器和压缩器优化您的应用程序,从而导致更大的捆绑包大小。相反,建议您在整个应用程序中使用 ECMAScript 模块。
如果 Angular CLI 检测到您的浏览器应用程序依赖于 CommonJS 模块,它会输出警告。若要禁用这些警告,请在 angular.json 文件中的构建选项中将 CommonJS 模块名称添加到 allowedCommonJsDependencies 选项中。