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

Make eventsource.min.js really optional #10

Closed
anonghuser opened this issue Sep 29, 2023 · 1 comment
Closed

Make eventsource.min.js really optional #10

anonghuser opened this issue Sep 29, 2023 · 1 comment
Assignees

Comments

@anonghuser
Copy link

anonghuser commented Sep 29, 2023

The README says this about eventsource.min.js:

<!-- you can exlude this if not listening to events (may cause runtime error) -->

But the way it is bundled, it always throws an EventSourcePolyfill is not defined error even if you don't use events.

You should change the output.globals.eventsource rollup config value from EventSourcePolyfill to globalThis.EventSourcePolyfill so it just resolves to undefined when missing instead of throwing an error. Then indeed the error will only happen when you try to use events and not every time.

@cemalgnlts
Copy link
Owner

Hi,

Thanks for the suggestion. I will try to fix the problem.

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