-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular 13 compatibility (and other frameworks/bundlers) #269
Comments
CH5C-4424 - WCT updated by Sharique
Thanks for putting this together. I was trying to go through this video to learn how to implement React with Crestron but I was running into a brick wall for a while getting this error after installing the @crestron/ch5-crcomlib package: It wouldn't work with either:
Your suggestions got me to where I need to be (I hope), but I wanted to add a few things I discovered along the way that might help others that find this thread (at least until Crestron decides to fix this). This is how I did it. Feel free to share improvements to my workflow.
|
At the moment, the library is published only in its amd, umd and cjs form. Would it be possible to also provide the unbundled esm format? Possibly also combined with specifying the
exports
(docs) field in package.json to make consuming bundlers aware of the available library formats.We are trying to use the components in an Angular 13 project so far without any luck. The provided shell template helps only a little, as it heavily relies either on old, custom or heavily configured tooling.
However, with some modifications, we were able to make the package work. Here are the changes:
package.json#exports
We added the exports field to package.json. This allowed the angular compiler to import the correct compiled library.
tsconfig.esm.json
npm build:dev:esm didn't seem to do anything. No errors and no artifacts created. We solved it by specifying
files
property intsconfig.esm.json
. There is probably a better way to solve this.Usage of process.env
CH5ComponentLibrary relies on webpack to replace
process.env
used in the source files. This doesn't work for the esm build which are built withtsc
only. Without further modifying the library, we opted to polyfillwindow.process.env
in the global scope of our app.The text was updated successfully, but these errors were encountered: