Angular worked on the build process in v10 and removed support for already transpiled code to ES5 for Angular Libraries. Also they now show a warning for every dependency that is imported in ES5.
More information:
https://angular.io/guide/build#configuring-commonjs-dependencies
Example warning:
WARNING in P:\XXX\XXX.js depends on graphql-tag. CommonJS or AMD
dependencies can cause optimization bailouts.
To avoid this we'd need an ES6 file in "main" property of package.json or at least a file in the lib folder in ES6 that can be imported directly. This should be the feature request of this issue.
Seems like #273 should fix this although it's an old PR.
@MatthiasKunnen
Any updates for this?
@nikita-lobkov, you should check the linked PRs for progress. None of these are mine so I'm afraid I can't give you an update.
on Angular v10 to remove all warnings:
File angular.json
"architect": {
"build": {
"options": {
"allowedCommonJsDependencies": [
"graphql-tag",
"zen-observable"
]
}
}
}
It's 2021 and I am still see this warning? along with another for Observable.
I am using Apollo for Angular.
Warning: /home/ ... /node_modules/@apollo/client/core/index.js depends on 'graphql-tag'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Warning: /home/ ... /node_modules/@apollo/client/utilities/observables/Observable.js depends on 'zen-observable'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Most helpful comment
It's 2021 and I am still see this warning? along with another for Observable.
I am using Apollo for Angular.