Closed sarunint closed 3 years ago
I'm open to any help with the packaging 😃Feel free to fire over a PR, even if just a proof of concept.
Any updates?
aw look like update to angularfire 6 (not release) will solve the problem https://github.com/angular/angularfire/pull/2282
Version info
Angular: 8.0.0-beta.6
Firebase: 5.8.4
AngularFire: 5.1.1
Other (e.g. Ionic/Cordova, Node, browser, operating system): N/A
See AngularFire code structure: https://unpkg.com/@angular/fire@5.1.1/
I tried using Angular Compatibility Compiler to compile AngularFire. The ES2015 is compiled correctly. But ESM5 is not compiled.
During FESM5 pass,
ivy-ngcc
will parse index.js in the library root, because that is specify inmodule
field inpackage.json
.Unfortunately, during
ts.createProgram
call inmakeBundleProgram
, TypeScript cannot load filepublic_api.js
that is specified inindex.js
. This is due to the resolve order of TypeScript. It goes.ts
,.tsx
,.d.ts
,.js
,.jsx
. (Reference 1 and 2) TypeScript findspublic_api.d.ts
first, as it also resides in the library root.This problem will not occur if AngularFire decide to follow Angular Package Format.
module
key is meant for flattened ESM5.I believe this cannot be fixed in the
ivy-ngcc
itself, since the order of file resolving is hard coded in TypeScript library. So, the best course of action would be turning AngularFire to match the Angular Package Format.I can do the PR to fix this, but I want some approval before doing so.
Please take a look and let me know what I can help.