Replies: 2 comments
-
|
For Angular, you can add the But you may still face another error: |
Beta Was this translation helpful? Give feedback.
-
|
In my opinion, shifting the burden of configuration to the user is a significant barrier to adoption. Forcing users to config to use the package suggests the package is not "web ready." Typical user will include the package, get an error, and assume the package is broken. I am currently using a postinstall patch file which removes the node-specific blocks of code from the library entirely. The top-level await was not an issue for me when I was building the package, possibly because i am using zoneless Angular. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When trying to use the library in a Angular project this build error is thrown
Even though it's guarded by
if (ENVIRONMENT_IS_NODE), the esbuild bundler (used by Angular) statically analyzes all imports and fails when it sees the nodemoduleimport.To fix this I created a custom browser build by making a separate libxml2raw.browser.mjs file with
ENVIRONMENT=web:Then update package.json with the file mapping for browsers:
Would it be possible to add this to the library?
Beta Was this translation helpful? Give feedback.
All reactions