Skip to content
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

Dynamic import issue when a bundle package in ESM with node-gelf-pro #85

Closed
Jay-WKJun opened this issue Apr 11, 2023 · 1 comment
Closed

Comments

@Jay-WKJun
Copy link

Jay-WKJun commented Apr 11, 2023

Hi. I am currently using your library with pleasure for Graylog on a node server. (Thanks for your contribution!)

However, I had trouble when I tried to bundle only the "send" feature for Graylog into a separate package using rollup.js bundler.

Because, dynamic import for adapter modules make some issues.

To solve this issue, I think change the code with static import or make new lib of ESM with migration.

I think change with static import could improve your library with tree shakable library.

(For example, When lib user set the adapter statically, another adapter module would not to be included in user's bundle)

스크린샷 2023-04-11 오전 11 40 42

스크린샷 2023-04-11 오전 11 41 28

I would like to Pull Request for you for resolve this issue.

or any errors, comment or mail me anytime.

Thank you.

env

Macbook pro M1, OS Ventura 13.3.1

rollup v.3.20.2

@kkamkou
Copy link
Owner

kkamkou commented Apr 11, 2023

Try to play with dynamicRequireTargets as your tool wants. You can also require existing adapter and set it via https://github.com/kkamkou/node-gelf-pro#third-party-adapters (as your tool scans for require matches)

@kkamkou kkamkou closed this as completed Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants