Closed ivarcode closed 2 years ago
Face-palming a little bit now, I created an index.d.ts
file and included in my tsconfig.lib.json
the following line:
"typeRoots": ["./src/lib/typings"],
and it seems to be working. Will close this issue when I confirm that this is the solution I was looking for.
EDIT: confirmed!
I have been using this library for a good while now within an angular application with no problems. I recently have started pulling code out of that application to create a library so multiple applications in my company can use the same components and services. I am now having build issues, described below.
Disclaimer: this might not be an issue with the angular-cesium library, but I expect you're the correct people to raise this question to. Please direct me who you think I should address with this question if you don't think it fits here.
Intended outcome:
When I run
ng build <my_project>
I expect it to build properly and give me a consumable package I can publish to our internal package registry.Actual outcome:
Instead, I get the following errors (all the same) for every instance I use the Cesium global.
I have a demo application within the same workspace (the Angular workspace is what contains the
projects/
directory) which I can successfullyng serve
and run. All references toCesium
work. That demo app contains atyping.d.ts
file as described in your documentation, but I cannot determine how to declare a global that gets recognized the same way when compiling an angular library.Similarly, I cannot include the following in the build configurations as these properties are not allowed in the build options for libraries, as they are in the build options for applications.
Really, the key to this seems like a question of how to go about doing the same thing we did with the
typing.d.ts
file for applications, but for my library. Everything else seems to work fine, if I could just get the compiler to respect thatCesium
will exist at runtime.How to reproduce the issue:
I cannot supply any source code but I can supply snippets of configuration files upon request.
The versions of the dependencies involved are here:
Version